This commit is contained in:
Nunzio Andrea Galante 2017-09-01 16:59:47 +00:00
parent 2c06d9bee8
commit 0240c67d74
1 changed files with 27 additions and 8 deletions

View File

@ -20,6 +20,9 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
***REMOVED***
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.ws.rs.core.NewCookie;
@ -429,9 +432,9 @@ public class SVNUpdater {
***REMOVED***
***REMOVED***
public String generateAlgorithmEntry(Algorithm algorithm, String targetVRE, String category, String algorithm_type,String env) {
public String generateAlgorithmEntry(Algorithm algorithm, String targetVRE, String category, String algorithm_type,String env) throws ParseException {
***REMOVED***Timestamp timestamp = new Timestamp(System.currentTimeMillis());
long unixTime = System.currentTimeMillis() / 1000L;
***REMOVED***long unixTime = System.currentTimeMillis() / 1000L;
StringBuffer sb = new StringBuffer("| ");
sb.append(algorithm.getName() + " | ");
@ -442,7 +445,7 @@ public class SVNUpdater {
+ algorithm.getClazz() + " " + targetVRE + " " + algorithm_type + " N "
+ algorithm.getPackageURL() + " \"" + algorithm.getDescription() + "\" </notextile> | ");
sb.append("none | ");
sb.append(unixTime + " | ");
sb.append(this.getTimeZone() + " | ");
return sb.toString();
***REMOVED***
@ -638,9 +641,18 @@ public class SVNUpdater {
***REMOVED***
public String getTimeZone() throws ParseException{
Calendar cal = Calendar.getInstance();
cal.getTime();
DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
Date fromDate = (Date)formatter.parse(cal.getTime().toString());
TimeZone central = TimeZone.getTimeZone("UTC");
formatter.setTimeZone(central);
System.out.println(formatter.format(fromDate));
return formatter.format(fromDate);
***REMOVED***
public static void main(String[] args) throws SVNException {
public static void main(String[] args) throws SVNException, ParseException {
ServiceConfiguration sc = new ServiceConfiguration("/home/ngalante/workspace/dataminer-pool-manager/src/main/resources/service.properties");
@ -648,12 +660,19 @@ public class SVNUpdater {
***REMOVED***File a = new File("/home/ngalante/Desktop/testCiro");
***REMOVED***File b = new File ("/home/ngalante/Desktop/testB");
long unixTime = System.currentTimeMillis() / 1000L;
System.out.println(unixTime);
***REMOVED***long unixTime = System.currentTimeMillis() / 1000L;
***REMOVED***System.out.println(unixTime);
***REMOVED***c.updateAlgorithmFiles(a);
***REMOVED***c.updateAlgorithmFiles(b);
***REMOVED***Timestamp timestamp = new Timestamp(System.currentTimeMillis());
Calendar cal = Calendar.getInstance();
cal.getTime();
DateFormat formatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
Date fromDate = (Date)formatter.parse(cal.getTime().toString());
TimeZone central = TimeZone.getTimeZone("UTC");
formatter.setTimeZone(central);
System.out.println(formatter.format(fromDate));