diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/pom.xml | 36 | ||||
-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 |
3 files changed, 50 insertions, 7 deletions
diff --git a/common/pom.xml b/common/pom.xml index fffb1a460..cde0c6ed8 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -3,11 +3,11 @@ <parent> <groupId>MOA</groupId> <artifactId>MOA</artifactId> - <version>2.0.1</version> + <version>2.x</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>moa-common</artifactId> - <!-- <version>2.0.0</version> --> + <version>${moa-commons-version}</version> <packaging>jar</packaging> <name>MOA common library</name> @@ -74,21 +74,26 @@ <artifactId>slf4j-api</artifactId> <version>1.7.6</version> </dependency> - <dependency> +<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.6</version> - </dependency> + </dependency> --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.7.6</version> </dependency> - <dependency> +<!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> <version>1.7.6</version> - </dependency> + </dependency> --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.7.6</version> + </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jul-to-slf4j</artifactId> @@ -98,6 +103,25 @@ <build> <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>properties-maven-plugin</artifactId> + <version>1.0-alpha-2</version> + <executions> + <execution> + <phase>initialize</phase> + <goals> + <goal>read-project-properties</goal> + </goals> + <configuration> + <files> + <file>${basedir}/../moa-id.properties</file> + </files> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> 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; |