* right versioning and buildtime variables
* new INFO object to store buildtime and version
This commit is contained in:
35
src/java/com/wasteinformationserver/basicutils/Info.java
Normal file
35
src/java/com/wasteinformationserver/basicutils/Info.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.wasteinformationserver.basicutils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Info {
|
||||
public static String version="0.0";
|
||||
public static String builddate;
|
||||
|
||||
|
||||
public static void init(){
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
|
||||
|
||||
URL url = Info.class.getResource("/version.properties");
|
||||
|
||||
String builddatee = format.format(new Date(new File(url.toURI()).lastModified()));
|
||||
builddate=builddatee;
|
||||
|
||||
prop.load(url.openStream());
|
||||
version=(String)prop.get("version");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user