summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
index 597e4306..04212c42 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java
@@ -156,22 +156,23 @@ public class FileServer implements IncomingEvent {
+ "/" + Constants.MAX_UPLOADS + ").");
}
File destinationFile = null;
+ String uploadkey = UUID.randomUUID().toString();
do {
- destinationFile = Formatter.getTempImageName();
+ destinationFile = Formatter.getTempImageName(uploadkey);
} while (destinationFile.exists());
destinationFile.getParentFile().mkdirs();
- String key = UUID.randomUUID().toString();
IncomingDataTransfer upload;
try {
- upload = new IncomingDataTransfer(key, owner, image, destinationFile, fileSize, sha1Sums,
+ upload = new IncomingDataTransfer(uploadkey, owner, image, destinationFile, fileSize, sha1Sums,
machineDescription, false);
} catch (FileNotFoundException e) {
LOGGER.error("Could not open destination file for writing", e);
throw new TTransferRejectedException("Destination file not writable!");
}
- uploads.put(key, upload);
+ LOGGER.info(owner.getFirstName() + " " + owner.getLastName() + " (" + owner.getUserId() + ") started upload " + uploadkey + " of '" + image.getImageName() + "'");
+ uploads.put(uploadkey, upload);
return upload;
}