How to get lastModified time of a file within a jar file on the classpath?
Created May 7, 2012
Jens Dibbern If you know the jar file, you can open it as a java.util.jar.JarFile
object and use getJarEntry
to retrieve the file in question as a java.util.jar.JarEntry object.
After that you can call getTime.
If you do not know the jar file, you have to get the classpath by String classPath = System.getProperty("java.class.path"); and try every jar file included.
Sorry about the last bit - I know it looks quite clumsy.
If you do not know the jar file, you have to get the classpath by String classPath = System.getProperty("java.class.path"); and try every jar file included.
Sorry about the last bit - I know it looks quite clumsy.