diff options
Diffstat (limited to 'common/src/main/java/at')
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java | 14 | ||||
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java | 7 |
2 files changed, 20 insertions, 1 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java index 1e219b784..dbc9faba6 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java @@ -107,6 +107,20 @@ public class DateTimeUtils { } /** + * Builds a <code>dateTime</code> value in UTC from a <code>Calendar</code> value. + * @param cal the <code>Calendar</code> value + * @return the <code>dateTime</code> value + */ + public static String buildDateTimeUTC(Date cal) { + + SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + f.setTimeZone(TimeZone.getTimeZone("UTC")); + + return f.format(cal); + + } + + /** * Builds a <code>dateTime</code> value from a <code>Calendar</code> value. * @param cal the <code>Calendar</code> value * @return the <code>dateTime</code> value diff --git a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java index ff22c7313..a70d62e1e 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/FileUtils.java @@ -133,7 +133,12 @@ public class FileUtils { keyFile = new File(url); if (!keyFile.isAbsolute()) { keyFile = new File(root, url); - newURL = keyFile.toURI().toString(); + + if (keyFile.toString().startsWith("file:")) + newURL = keyFile.toString(); + + else + newURL = keyFile.toURI().toString(); } return newURL; |