is it possible to get a File or URI object for a file inside an archive with Java? (zip or jar archive)
Thanks Hemeroc.
public List getFilesInJar(String jarName){
List result = new ArrayList();
File jarFile = new File(jarName);
JarInputStream jarFile = new JarInputStream(new FileInputStream(jarFile));
JarEntry jarEntry;
while ((jarEntry = jarFile.getNextJarEntry()) != null) {
result.add(inputStreamToFile(jarFile.getInputStream(jarEntry)));
}
return result;
}
for the inputStreamToFile method, google "java inputStream to file", although you might be happy with an InputStream object also, instead of a File object :)