From 76848f356ab161bcf53f14dc21fb2200605a9a95 Mon Sep 17 00:00:00 2001 From: Nils Schwabe Date: Mon, 18 Aug 2014 15:58:12 +0200 Subject: Remove some hardcoded stuff --- src/main/java/org/openslx/satellitedaemon/Globals.java | 4 ++++ .../org/openslx/satellitedaemon/filetransfer/FileDownloadWorker.java | 2 +- .../org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openslx/satellitedaemon/Globals.java b/src/main/java/org/openslx/satellitedaemon/Globals.java index d33be1d..38be1f3 100644 --- a/src/main/java/org/openslx/satellitedaemon/Globals.java +++ b/src/main/java/org/openslx/satellitedaemon/Globals.java @@ -61,6 +61,10 @@ public class Globals { public static String getThriftKeystorePath() { return properties.getProperty("THRIFT_KEYSTORE_PATH"); } + + public static String getImageFolder() { + return properties.getProperty("IMAGE_FOLDER"); + } // Integers // public static int getFiletransferPort() { diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/FileDownloadWorker.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/FileDownloadWorker.java index f15cbb5..e0f9baf 100644 --- a/src/main/java/org/openslx/satellitedaemon/filetransfer/FileDownloadWorker.java +++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/FileDownloadWorker.java @@ -41,7 +41,7 @@ public class FileDownloadWorker implements Runnable { continue; } d.sendToken(downInfos.token); - d.setOutputFilename("/home/michael/Downloads/tescht.whatever"); + d.setOutputFilename(Globals.getImageFolder() + "/" + image.name + ".vmdk"); // TODO: how should images be saved? while (d.readMetaData()) // TODO: Request range... d.receiveBinary(); diff --git a/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java b/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java index 3515085..e19c222 100644 --- a/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java +++ b/src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java @@ -28,7 +28,7 @@ public class FileUploadWorker implements Runnable { // with info from DbImage. ImageData imDat = new ImageData(image.guid, image.rid, image.name, System.currentTimeMillis(), - System.currentTimeMillis(), image.creator, "anyThing", + System.currentTimeMillis(), image.creator, "anyThing", // TODO: fields in databases need to fit somehow... true, false, "best", "theVeryBest", image.fileSize); // ImageData imDat = new ImageData( -- cgit v1.2.3-55-g7522