summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Petretti2014-06-26 14:26:49 +0200
committerMichael Petretti2014-06-26 14:26:49 +0200
commit9c2323ad98034a0e8a0039326ce4d5b8a01c38ed (patch)
tree654648fff05679691fb983754684beb6b5af1036
parentwrote a CRC32 Class. Not verified yet. (diff)
downloadsatellite-daemon-9c2323ad98034a0e8a0039326ce4d5b8a01c38ed.tar.gz
satellite-daemon-9c2323ad98034a0e8a0039326ce4d5b8a01c38ed.tar.xz
satellite-daemon-9c2323ad98034a0e8a0039326ce4d5b8a01c38ed.zip
removed a Method.
-rw-r--r--src/main/java/org/openslx/satellitedaemon/ftp/FtpImageUploader.java55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/ftp/FtpImageUploader.java b/src/main/java/org/openslx/satellitedaemon/ftp/FtpImageUploader.java
deleted file mode 100644
index db83646..0000000
--- a/src/main/java/org/openslx/satellitedaemon/ftp/FtpImageUploader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.openslx.satellitedaemon.ftp;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.SocketException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.TrustManagerFactory;
-
-import org.apache.commons.net.ftp.FTPSClient;
-import org.openslx.imagemaster.thrift.iface.FtpCredentials;
-
-public class FtpImageUploader
-{
- static String nilsIp = "132.230.4.23";
- static int ftpPort = 2221;
- FTPSClient ftpClient = new FTPSClient( "SSL", true );
- FtpCredentials ftpc = null;
-
- public FtpImageUploader(FtpCredentials ftpCredentials) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, FileNotFoundException, IOException {
- TrustManagerFactory trustManagerFactory = TrustManagerFactory
- .getInstance( KeyManagerFactory.getDefaultAlgorithm() );
- KeyStore keystore = KeyStore.getInstance( "JKS" );
- keystore.load( new FileInputStream( new File(
- "/home/michael/satellite-daemon/config/ftpsid.jks" ) ),
- "password".toCharArray() );
- trustManagerFactory.init( keystore );
- TrustManager trustManager = trustManagerFactory.getTrustManagers()[0];
- ftpClient.setTrustManager( trustManager );
- ftpc = ftpCredentials;
-
- }
-
- public void connectTest() throws SocketException, IOException {
- try {
- ftpClient.connect( nilsIp, ftpPort );
- if ( !ftpClient.login( ftpc.username, ftpc.password ) ) {
- throw new ConnectException( "Could not login." );
- }
- System.out.println( "Connected to " + nilsIp + ":" + ftpPort
- + ". Reply code: " + ftpClient.getReplyCode() );
- } finally {
- ftpClient.disconnect();
- }
- }
-
-}