Repository: camel Updated Branches: refs/heads/camel-2.12.x aaebb3362 -> ab0f85223
Rename the Default implement with the name rule of Camel Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/09c93c6f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/09c93c6f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/09c93c6f Branch: refs/heads/camel-2.12.x Commit: 09c93c6fa2341e99581ff057bb708916c739b4cb Parents: aaebb33 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Thu Feb 20 16:41:48 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Thu Feb 20 16:41:48 2014 +0800 ---------------------------------------------------------------------- .../crypto/DefaultPGPPassphraseAccessor.java | 54 ++++++++++++++++++++ .../crypto/PGPPassphraseAccessorDefault.java | 54 -------------------- .../converter/crypto/PGPDataFormatTest.java | 4 +- 3 files changed, 56 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/09c93c6f/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPPassphraseAccessor.java ---------------------------------------------------------------------- diff --git a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPPassphraseAccessor.java b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPPassphraseAccessor.java new file mode 100644 index 0000000..21c2105 --- /dev/null +++ b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/DefaultPGPPassphraseAccessor.java @@ -0,0 +1,54 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.converter.crypto; + +import java.util.Map; + +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import org.apache.camel.util.ObjectHelper; + +public class DefaultPGPPassphraseAccessor implements PGPPassphraseAccessor { + + private final Map<String, String> userId2Passphrase; + + public DefaultPGPPassphraseAccessor(Map<String, String> userId2Passphrase) { + ObjectHelper.notNull(userId2Passphrase, "userIdPassphrase"); + + this.userId2Passphrase = userId2Passphrase; + } + + @Override + public String getPassphrase(String userId) { + return userId2Passphrase.get(userId); + } + +} http://git-wip-us.apache.org/repos/asf/camel/blob/09c93c6f/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPPassphraseAccessorDefault.java ---------------------------------------------------------------------- diff --git a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPPassphraseAccessorDefault.java b/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPPassphraseAccessorDefault.java deleted file mode 100644 index 6796ccd..0000000 --- a/components/camel-crypto/src/main/java/org/apache/camel/converter/crypto/PGPPassphraseAccessorDefault.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.converter.crypto; - -import java.util.Map; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import org.apache.camel.util.ObjectHelper; - -public class PGPPassphraseAccessorDefault implements PGPPassphraseAccessor { - - private final Map<String, String> userId2Passphrase; - - public PGPPassphraseAccessorDefault(Map<String, String> userId2Passphrase) { - ObjectHelper.notNull(userId2Passphrase, "userIdPassphrase"); - - this.userId2Passphrase = userId2Passphrase; - } - - @Override - public String getPassphrase(String userId) { - return userId2Passphrase.get(userId); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/09c93c6f/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java ---------------------------------------------------------------------- diff --git a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java index 1aa7f7f..b017a86 100644 --- a/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java +++ b/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/PGPDataFormatTest.java @@ -321,7 +321,7 @@ public class PGPDataFormatTest extends AbstractPGPDataFormatTest { Map<String, String> userId2Passphrase = new HashMap<String, String>(); userId2Passphrase.put("Third (comment third) <em...@third.com>", "sdude"); userId2Passphrase.put("Second <em...@second.com>", "sdude"); - PGPPassphraseAccessor passphraseAccessorSeveralKeys = new PGPPassphraseAccessorDefault(userId2Passphrase); + PGPPassphraseAccessor passphraseAccessorSeveralKeys = new DefaultPGPPassphraseAccessor(userId2Passphrase); pgpSignAndEncryptSeveralSignerKeys.setPassphraseAccessor(passphraseAccessorSeveralKeys); PGPDataFormat pgpVerifyAndDecryptSeveralSignerKeys = new PGPDataFormat(); @@ -411,7 +411,7 @@ public class PGPDataFormatTest extends AbstractPGPDataFormatTest { public static PGPPassphraseAccessor getPassphraseAccessor() { Map<String, String> userId2Passphrase = Collections.singletonMap("Super <sd...@nowhere.net>", "sdude"); - PGPPassphraseAccessor passphraseAccessor = new PGPPassphraseAccessorDefault(userId2Passphrase); + PGPPassphraseAccessor passphraseAccessor = new DefaultPGPPassphraseAccessor(userId2Passphrase); return passphraseAccessor; }