From 56fb96f87e126756061e730924e3b6c7fcf743bc Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 27 Jun 2012 08:27:08 +0000 Subject: [PATCH] not fail when timestamp has a bad format git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1354367 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/web/runtime/ArchivaRuntimeInfo.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/runtime/ArchivaRuntimeInfo.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/runtime/ArchivaRuntimeInfo.java index 8f2932c8e..a2e3d58db 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/runtime/ArchivaRuntimeInfo.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/runtime/ArchivaRuntimeInfo.java @@ -23,6 +23,7 @@ import org.springframework.stereotype.Service; import javax.inject.Inject; import javax.inject.Named; +import java.util.Date; import java.util.Properties; /** @@ -47,7 +48,15 @@ public class ArchivaRuntimeInfo { this.version = (String) archivaRuntimeProperties.get( "archiva.version" ); this.buildNumber = (String) archivaRuntimeProperties.get( "archiva.buildNumber" ); - this.timestamp = NumberUtils.createLong( (String) archivaRuntimeProperties.get( "archiva.timestamp" ) ); + String archivaTimeStamp = (String) archivaRuntimeProperties.get( "archiva.timestamp" ); + if ( NumberUtils.isNumber( archivaTimeStamp ) ) + { + this.timestamp = NumberUtils.createLong( archivaTimeStamp ); + } + else + { + this.timestamp = new Date().getTime(); + } this.devMode = Boolean.getBoolean( "archiva.devMode" ); } -- 2.39.5