X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=datafilecollector%2Fsrc%2Fmain%2Fjava%2Forg%2Foran%2Fdatafile%2Fftp%2FFtpesClient.java;h=8e61558bbf6f080980dc87bcfb5c1bdb663b0501;hb=3a9d09f02a50cf1174a6e9ccf8e7d0af88a7ecf3;hp=06313e5da2d6165e2b9372ee5507acf25d96e706;hpb=f0af18429aec79a590835103fedd753ee5ea93a9;p=nonrtric%2Fplt%2Franpm.git diff --git a/datafilecollector/src/main/java/org/oran/datafile/ftp/FtpesClient.java b/datafilecollector/src/main/java/org/oran/datafile/ftp/FtpesClient.java index 06313e5..8e61558 100644 --- a/datafilecollector/src/main/java/org/oran/datafile/ftp/FtpesClient.java +++ b/datafilecollector/src/main/java/org/oran/datafile/ftp/FtpesClient.java @@ -22,7 +22,9 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.security.GeneralSecurityException; import java.security.KeyStore; import java.security.KeyStoreException; @@ -39,10 +41,9 @@ import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPReply; import org.apache.commons.net.ftp.FTPSClient; import org.oran.datafile.commons.FileCollectClient; -import org.oran.datafile.commons.FileServerData; -import org.oran.datafile.commons.SecurityUtil; import org.oran.datafile.exceptions.DatafileTaskException; import org.oran.datafile.exceptions.NonRetryableDatafileTaskException; +import org.oran.datafile.model.FileServerData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.FileSystemResource; @@ -195,7 +196,7 @@ public class FtpesClient implements FileCollectClient { throws KeyStoreException, NoSuchAlgorithmException, IOException, CertificateException { synchronized (FtpesClient.class) { if (theTrustManager == null && trustedCaPath != null) { - String trustedCaPassword = SecurityUtil.getTruststorePasswordFromFile(trustedCaPasswordPath); + String trustedCaPassword = Files.readString(Paths.get((trustedCaPasswordPath))); theTrustManager = createTrustManager(trustedCaPath, trustedCaPassword); } return theTrustManager; @@ -207,7 +208,7 @@ public class FtpesClient implements FileCollectClient { synchronized (FtpesClient.class) { if (theKeyManager == null) { - String keyCertPassword = SecurityUtil.getKeystorePasswordFromFile(keyCertPasswordPath); + String keyCertPassword = Files.readString(Paths.get((keyCertPasswordPath))); theKeyManager = createKeyManager(keyCertPath, keyCertPassword); } return theKeyManager;