import java.net.URL;
import java.net.URLConnection;
import java.util.Date;
public class TestCompileTime {
public TestCompileTime() {
try {
System.out.println("build date:>>"+TestCompileTime.getCompileTimeStamp(this.getClass()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new TestCompileTime();
}
/**
* get date a class was compiled by looking at the corresponding class file in the jar.
* @author Zig
*/
public static Date getCompileTimeStamp( Class<?> cls ) throws IOException
{
ClassLoader loader = cls.getClassLoader();
String filename = cls.getName().replace('.', '/') + ".class";
// get the corresponding class file as a Resource.
URL resource=( loader!=null ) ?
loader.getResource( filename ) :
ClassLoader.getSystemResource( filename );
URLConnection connection = resource.openConnection();
// Note, we are using Connection.getLastModified not File.lastModifed.
// This will then work both or members of jars or standalone class files.
long time = connection.getLastModified();
return( time != 0L ) ? new Date( time ) : null;
}
}
· Card Export 3.12 2008/06/17
· 처음 만들어본 태터툴즈용 스킨 : Sunteq 심플 1단,2단 버전 2006/12/16
· 자바스크립트 속성 2007/07/01
· 오라클 시작, 종료 2008/03/20
· 싸이월드를 닮은 블로그 스킨 버전 0.1 2007/01/02
· 우분투 설치 고려사항 (진행중) 2008/11/06
· 오라클 날짜 타입관련 2007/06/21
· 유용한 무료 프로그램들 2007/05/04
· DeepFreeze - 부팅때마다 컴퓨터 원상태로 복구하는 프로그램 2007/08/20
· 스킨을 바꾸다. 2007/04/24





