Community
Participate
Working Groups
import java.io.*;
import java.util.*;
import java.util.jar.*;
import java.util.zip.ZipException;
/**
* @author aniefer@ca.ibm.com
JarFile jar = null;
try {
jar = new JarFile(jarFile, false);
} catch (ZipException e) {
//not a jar, don't bother logging this.
return null;
} catch (IOException e) {
if (verbose) {
System.out.println("Failed to obtain eclipse.inf due to IOException: " + jarFile);
e.printStackTrace();
}
JarEntry mark = jar.getJarEntry(MARK_FILE_NAME);
if (mark != null) {
InputStream in = jar.getInputStream(mark);
//not a jar
} finally {
close(jar);