Remove dependency on commons-codec 95/86195/1
authorJerry Flood <jflood@att.com>
Wed, 24 Apr 2019 20:10:56 +0000 (16:10 -0400)
committerJerry Flood <jflood@att.com>
Wed, 24 Apr 2019 20:11:24 +0000 (16:11 -0400)
Issue-ID: OPTFRA-479
Change-Id: Id8873f7df5011fa36465a36b2d39d637869d1426
Signed-off-by: Jerry Flood <jflood@att.com>
cmso-optimizer/pom.xml
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/common/PropertiesManagement.java
cmso-service/pom.xml
cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
cmso-ticketmgt/pom.xml
cmso-ticketmgt/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java
cmso-topology/pom.xml
cmso-topology/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java

index f6d2227..4281cf7 100644 (file)
                                </exclusion>
                        </exclusions>
                </dependency>
-               <dependency>
-                       <groupId>org.apache.httpcomponents</groupId>
-                       <artifactId>httpclient</artifactId>
-               </dependency>
                <dependency>
                        <groupId>commons-io</groupId>
                        <artifactId>commons-io</artifactId>
index 4b68176..12da757 100644 (file)
@@ -28,10 +28,10 @@ package org.onap.optf.cmso.optimizer.common;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
+import java.util.Base64;
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
-import org.apache.commons.codec.binary.Base64;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
@@ -104,7 +104,7 @@ public class PropertiesManagement {
             Cipher cipher = Cipher.getInstance(transformation);
             cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
             byte[] encrypted = cipher.doFinal(value.getBytes());
-            return Base64.encodeBase64String(encrypted);
+            return Base64.getEncoder().encodeToString(encrypted);
         } catch (Exception ex) {
             errors.error("Unexpected exception {0}", ex.getMessage());
             debug.debug("Unexpected exception", ex);
@@ -119,7 +119,7 @@ public class PropertiesManagement {
             SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
             Cipher cipher = Cipher.getInstance(transformation);
             cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
-            byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+            byte[] original = cipher.doFinal(Base64.getDecoder().decode(encrypted));
             return new String(original);
         } catch (Exception ex) {
             errors.error("Unexpected exception {0}", ex.getMessage());
index acc6db7..05c7962 100644 (file)
                                </exclusion>\r
                        </exclusions>\r
                </dependency>\r
-               <dependency>\r
-                       <groupId>org.apache.httpcomponents</groupId>\r
-                       <artifactId>httpclient</artifactId>\r
-               </dependency>\r
                <dependency>\r
                        <groupId>org.springframework</groupId>\r
                        <artifactId>spring-test</artifactId>\r
index de917e4..b16c52a 100644 (file)
@@ -33,10 +33,10 @@ package org.onap.optf.cmso.common;
 \r
 import com.att.eelf.configuration.EELFLogger;\r
 import com.att.eelf.configuration.EELFManager;\r
+import java.util.Base64;\r
 import javax.crypto.Cipher;\r
 import javax.crypto.spec.IvParameterSpec;\r
 import javax.crypto.spec.SecretKeySpec;\r
-import org.apache.commons.codec.binary.Base64;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.core.env.Environment;\r
 import org.springframework.stereotype.Component;\r
@@ -105,7 +105,7 @@ public class PropertiesManagement {
             Cipher cipher = Cipher.getInstance(transformation);\r
             cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);\r
             byte[] encrypted = cipher.doFinal(value.getBytes());\r
-            return Base64.encodeBase64String(encrypted);\r
+            return Base64.getEncoder().encodeToString(encrypted);\r
         } catch (Exception ex) {\r
             errors.error("Unexpected exception {0}", ex.getMessage());\r
             debug.debug("Unexpected exception", ex);\r
@@ -120,7 +120,7 @@ public class PropertiesManagement {
             SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");\r
             Cipher cipher = Cipher.getInstance(transformation);\r
             cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);\r
-            byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));\r
+            byte[] original = cipher.doFinal(Base64.getDecoder().decode(encrypted));\r
             return new String(original);\r
         } catch (Exception ex) {\r
             errors.error("Unexpected exception {0}", ex.getMessage());\r
index 7d6ee0e..4910ec4 100644 (file)
                </dependency>
                <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-loader-tools</artifactId> 
                        </dependency> -->
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-data-jpa</artifactId>
-               </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-tomcat</artifactId>
                                </exclusion>
                        </exclusions>
                </dependency>
-               <dependency>
-                       <groupId>org.apache.httpcomponents</groupId>
-                       <artifactId>httpclient</artifactId>
-               </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-test</artifactId>
index bcd9ca1..8d739ee 100644 (file)
@@ -33,10 +33,10 @@ package org.onap.optf.cmso.common;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
+import java.util.Base64;
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
-import org.apache.commons.codec.binary.Base64;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
@@ -106,7 +106,7 @@ public class PropertiesManagement {
             Cipher cipher = Cipher.getInstance(transformation);
             cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
             byte[] encrypted = cipher.doFinal(value.getBytes());
-            return Base64.encodeBase64String(encrypted);
+            return Base64.getEncoder().encodeToString(encrypted);
         } catch (Exception ex) {
             errors.error("Unexpected exception {0}", ex.getMessage());
             debug.debug("Unexpected exception", ex);
@@ -121,7 +121,7 @@ public class PropertiesManagement {
             SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
             Cipher cipher = Cipher.getInstance(transformation);
             cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
-            byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+            byte[] original = cipher.doFinal(Base64.getDecoder().decode(encrypted));
             return new String(original);
         } catch (Exception ex) {
             errors.error("Unexpected exception {0}", ex.getMessage());
index 4809a93..19ea398 100644 (file)
                </dependency>
                <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-loader-tools</artifactId> 
                        </dependency> -->
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-data-jpa</artifactId>
-               </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-tomcat</artifactId>
                                </exclusion>
                        </exclusions>
                </dependency>
-               <dependency>
-                       <groupId>org.apache.httpcomponents</groupId>
-                       <artifactId>httpclient</artifactId>
-               </dependency>
                <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-test</artifactId>
index 1993b82..fadad45 100644 (file)
@@ -28,10 +28,10 @@ package org.onap.optf.cmso.common;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
+import java.util.Base64;
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
-import org.apache.commons.codec.binary.Base64;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
@@ -98,7 +98,7 @@ public class PropertiesManagement {
             Cipher cipher = Cipher.getInstance(transformation);
             cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
             byte[] encrypted = cipher.doFinal(value.getBytes());
-            return Base64.encodeBase64String(encrypted);
+            return Base64.getEncoder().encodeToString(encrypted);
         } catch (Exception ex) {
             errors.error("Unexpected exception {0}", ex.getMessage());
             debug.debug("Unexpected exception", ex);
@@ -113,7 +113,7 @@ public class PropertiesManagement {
             SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
             Cipher cipher = Cipher.getInstance(transformation);
             cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
-            byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+            byte[] original = cipher.doFinal(Base64.getDecoder().decode(encrypted));
             return new String(original);
         } catch (Exception ex) {
             errors.error("Unexpected exception {0}", ex.getMessage());