summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Schwabe2014-08-18 15:58:12 +0200
committerNils Schwabe2014-08-18 15:58:12 +0200
commit76848f356ab161bcf53f14dc21fb2200605a9a95 (patch)
tree40eb34d8b42f399c4b5193a8b56d52014970ed50
parentAdd global.properties.example (diff)
downloadsatellite-daemon-76848f356ab161bcf53f14dc21fb2200605a9a95.tar.gz
satellite-daemon-76848f356ab161bcf53f14dc21fb2200605a9a95.tar.xz
satellite-daemon-76848f356ab161bcf53f14dc21fb2200605a9a95.zip
Remove some hardcoded stuff
-rw-r--r--src/main/java/org/openslx/satellitedaemon/Globals.java4
-rw-r--r--src/main/java/org/openslx/satellitedaemon/filetransfer/FileDownloadWorker.java2
-rw-r--r--src/main/java/org/openslx/satellitedaemon/filetransfer/FileUploadWorker.java2
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(