diff options
author | Steffen Ritter | 2023-06-02 15:46:50 +0200 |
---|---|---|
committer | Steffen Ritter | 2023-06-02 15:56:39 +0200 |
commit | f500d1a5cf47230a26a4e2b2fe124815052578da (patch) | |
tree | b3299f7115eba5e8355068b3d8bbcf81b57d5c3b /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java | |
parent | [server] Fix possible NPE (diff) | |
download | tutor-module-f500d1a5cf47230a26a4e2b2fe124815052578da.tar.gz tutor-module-f500d1a5cf47230a26a4e2b2fe124815052578da.tar.xz tutor-module-f500d1a5cf47230a26a4e2b2fe124815052578da.zip |
[server] Use upload token as filename for ongoing uploads
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java index 268ceda1..0bdc0ab7 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java @@ -26,6 +26,20 @@ public class Formatter { } /** + * Generate a file name used for a virtual machine + * image that is currently uploading, but use a given + * string as part of the file name. + * String should be some random uuid to get a unique + * file name. + * + * @param s String to use as part of the filename + * @return Absolute path name of file + */ + public static File getTempImageName(String s) { + return new File(Configuration.getCurrentVmStorePath(), s + Constants.INCOMPLETE_UPLOAD_SUFFIX); + } + + /** * Generate a file name for the given VM based on owner and display name. * * @param ts Timestamp of upload |