1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
public boolean classExist(String classe,JarFile jar) {
Vector<String> classFiles = new Vector<String>();
String name;
try {
Enumeration MonFichierEntrees = jar.entries();
while (MonFichierEntrees.hasMoreElements()) {
JarEntry entry = (JarEntry) MonFichierEntrees.nextElement();
name = entry.getName();
if (name.endsWith(".class")) {
//System.out.println(name.replace("/", "."));
classFiles.addElement(name.replace("/", "."));
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (classFiles.contains(classe))
return true;
else
return false;
} // end classExist() |
Partager