1 package org.tanukisoftware.wrapper; 2 3 45 46 import java.util.Calendar ; 47 import java.text.DateFormat ; 48 import java.text.SimpleDateFormat ; 49 import java.text.ParseException ; 50 51 57 final class WrapperInfo 58 { 59 60 private static final String m_version = "3.2.3"; 61 62 63 private static final Calendar m_build = Calendar.getInstance(); 64 65 67 static 68 { 69 Calendar buildDate = Calendar.getInstance(); 70 Calendar buildTime = Calendar.getInstance(); 71 try 72 { 73 buildDate.setTime( new SimpleDateFormat ( "yyyyMMdd" ).parse( "20061017" ) ); 74 buildTime.setTime( new SimpleDateFormat ( "HHmm" ).parse( "2319" ) ); 75 76 m_build.set( buildDate.get( Calendar.YEAR ), 77 buildDate.get( Calendar.MONTH ), 78 buildDate.get( Calendar.DATE ), 79 buildTime.get( Calendar.HOUR_OF_DAY ), 80 buildTime.get( Calendar.MINUTE ) ); 81 82 } 83 catch ( ParseException e ) 84 { 85 System.out.println( "Can not parse build date: " + e.getMessage() ); 86 } 87 } 88 89 94 static String getVersion() 95 { 96 return m_version; 97 } 98 99 104 static String getBuildTime() 105 { 106 DateFormat df = new SimpleDateFormat ( "HH:mm zz MMM d, yyyy" ); 107 return df.format( m_build.getTime() ); 108 } 109 110 113 116 private WrapperInfo() 117 { 118 } 119 } 120 121 | Popular Tags |