summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java
diff options
context:
space:
mode:
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.java5
1 files changed, 3 insertions, 2 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 f13df0eb..268ceda1 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
@@ -28,13 +28,14 @@ public class Formatter {
/**
* Generate a file name for the given VM based on owner and display name.
*
+ * @param ts Timestamp of upload
* @param user The user associated with the VM, e.g. the owner
* @param imageName Name of the VM
* @param ext
* @return File name for the VM derived from the function's input
*/
- public static String vmName(UserInfo user, String imageName, String ext) {
- return cleanFileName(vmNameDateFormat.print(System.currentTimeMillis()) + "_" + user.lastName + "_"
+ public static String vmName(long ts, UserInfo user, String imageName, String ext) {
+ return cleanFileName(vmNameDateFormat.print(ts) + "_" + user.lastName + "_"
+ imageName + "." + ext).toLowerCase();
}