JarFile

public class JarFile extends ZipFile

The JarFile class is used to read the contents of a jar file from any file that can be opened with java.io.RandomAccessFile. It extends the class java.util.zip.ZipFile with support for reading an optional Manifest entry. The Manifest can be used to specify meta-information about the jar file and its entries.

Unless otherwise noted, passing a null argument to a constructor or method in this class will cause a NullPointerException to be thrown.

Constant Summary

String MANIFEST_NAME The JAR manifest file name.

Inherited Constant Summary

Public Constructor Summary

JarFile(String name)
Creates a new JarFile to read from the specified file name.
JarFile(String name, boolean verify)
Creates a new JarFile to read from the specified file name.
JarFile(File file)
Creates a new JarFile to read from the specified File object.
JarFile(File file, boolean verify)
Creates a new JarFile to read from the specified File object.
JarFile(File file, boolean verify, int mode)
Creates a new JarFile to read from the specified File object in the specified mode.

Public Method Summary

Enumeration<JarEntry>
entries()
Returns an enumeration of the zip file entries.
ZipEntry
getEntry(String name)
Returns the ZipEntry for the given entry name or null if not found.
synchronized InputStream
getInputStream(ZipEntry ze)
Returns an input stream for reading the contents of the specified zip file entry.
JarEntry
getJarEntry(String name)
Returns the JarEntry for the given entry name or null if not found.
Manifest
getManifest()
Returns the jar file manifest, or null if none.

Inherited Method Summary