mirror of
https://github.com/apache/archiva.git
synced 2025-02-06 10:09:32 +00:00
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
This commit is contained in:
parent
f57fc8bec7
commit
56fb96f87e
@ -23,6 +23,7 @@
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
@ -47,7 +48,15 @@ public ArchivaRuntimeInfo( @Named( value = "archivaRuntimeProperties" ) Properti
|
||||
{
|
||||
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" );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user