I have a jar file named "san.jar" with various folders like "classes", "resources", etc., Say for e.g i have a folder structure like "resources/assets/images" under which there are various images which I do not have any information about them like name of the images or number of images under the folder as the jar file is private and I am not allowed to unzip the jar.
OBJECTIVE: I need to get all the files under the given path without iterating over the whole jar file.
Right now what I am doing is iterating through each and every entry and whenever i come across .jpg file, I perform some operation. Here for reading just the "resources/assets/images", I am iterating through the whole jarfile.
JarFile jarFile = new JarFile("san.jar");
for(Enumeration em = jarFile.entries(); em.hasMoreElements();) {
String s= em.nextElement().toString();
if(s.contains("jpg")){
//do something
}
}
Right now what I am doing is iterating through each and every entry and whenever i come across .jpg file, I perform some operation. Here for reading just the "resources/assets/images", I am iterating through the whole jarfile.