camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [05/11] camel git commit: Changed type from StandardPBEStringEncryptor to StringEncryptor interface for getEncryptor() and setEncryptor().
Date Tue, 30 Dec 2014 10:48:32 GMT
Changed type from StandardPBEStringEncryptor to StringEncryptor interface for getEncryptor()
and setEncryptor().


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d5556f6e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d5556f6e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d5556f6e

Branch: refs/heads/master
Commit: d5556f6efc567f91c2afa3c1f0eda0c8c633979e
Parents: 594379b
Author: Marius Thøring <mthoring@gmail.com>
Authored: Fri Dec 26 18:02:07 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 30 11:47:29 2014 +0100

----------------------------------------------------------------------
 .../component/jasypt/JasyptPropertiesParser.java      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d5556f6e/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
----------------------------------------------------------------------
diff --git a/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
b/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
index 8a0e81c..c49df99 100755
--- a/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
+++ b/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
 
 import org.apache.camel.component.properties.DefaultPropertiesParser;
 import org.apache.camel.util.ObjectHelper;
+import org.jasypt.encryption.StringEncryptor;
 import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
 
 /**
@@ -37,7 +38,7 @@ public class JasyptPropertiesParser extends DefaultPropertiesParser {
     public static final String JASYPT_PREFIX_TOKEN = "ENC(";
     public static final String JASYPT_SUFFIX_TOKEN = ")";
 
-    private StandardPBEStringEncryptor encryptor;
+    private StringEncryptor encryptor;
     private String password;
     private String algorithm;
 
@@ -71,21 +72,22 @@ public class JasyptPropertiesParser extends DefaultPropertiesParser {
         this.algorithm = algorithm;
     }
 
-    public synchronized StandardPBEStringEncryptor getEncryptor() {
+    public synchronized StringEncryptor getEncryptor() {
         if (encryptor == null) {
             // password is mandatory
             ObjectHelper.notEmpty("password", getPassword());
 
-            encryptor = new StandardPBEStringEncryptor();
-            encryptor.setPassword(getPassword());
+            StandardPBEStringEncryptor pbeStringEncryptor = new StandardPBEStringEncryptor();
+            pbeStringEncryptor.setPassword(getPassword());
             if (algorithm != null) {
-                encryptor.setAlgorithm(getAlgorithm());
+                pbeStringEncryptor.setAlgorithm(getAlgorithm());
             }
+            encryptor = pbeStringEncryptor;
         }
         return encryptor;
     }
 
-    public void setEncryptor(StandardPBEStringEncryptor encryptor) {
+    public void setEncryptor(StringEncryptor encryptor) {
         this.encryptor = encryptor;
     }
 


Mime
View raw message