diff options
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 |