summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java')
-rw-r--r--src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java b/src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java
index e4e4b7c..69c73a9 100644
--- a/src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java
+++ b/src/main/java/org/openslx/satellitedaemon/ftp/FtpUploadWorker.java
@@ -19,6 +19,9 @@ import javax.net.ssl.TrustManagerFactory;
import org.apache.commons.net.ftp.FTPSClient;
import org.openslx.imagemaster.thrift.iface.FtpCredentials;
import org.openslx.imagemaster.thrift.iface.ImageData;
+import org.openslx.satellitedaemon.Globals;
+import org.openslx.satellitedaemon.Globals.PropInt;
+import org.openslx.satellitedaemon.Globals.PropString;
import org.openslx.satellitedaemon.db.DbImage;
public class FtpUploadWorker implements Runnable
@@ -55,7 +58,7 @@ public class FtpUploadWorker implements Runnable
FTPSClient ftpClient = new FTPSClient( "SSL", true );
ftpClient.setTrustManager( trustManager );
try {
- ftpClient.connect( nilsIp, ftpPort );
+ ftpClient.connect( Globals.getPropertyString( PropString.FTPSERVERIP ), Globals.getPropertyInt( PropInt.FTPPORT ) );
if ( !ftpClient.login( ftpc.username, ftpc.password ) ) {
throw new ConnectException( "Could not login." ); // TODO: Should not throw exception, otherwise we'd exit the run() method
}
@@ -63,7 +66,7 @@ public class FtpUploadWorker implements Runnable
// + ". Reply code: " + ftpClient.getReplyCode() );
// TODO: Where do I find the path to the db-image? <-- in DbImage. It's relative, base path should come from config/???.properties (global static config class, see masterserver's Globals class)
- File file = new File( "/path/to/File" );
+ File file = new File( imageList.get( 0 ).path );
FileInputStream fis = new FileInputStream( file );
// TODO: What is the path where it should be stored? <-- Should be set in the FtpCredentials you get via Thrift, but doesn't really matter, Server can decide to ignore the name and pick own (talk to Nils)