java.util.jar
public class JarFile extends ZipFile
Note that this class is not a subclass of java.io.File but a subclass of java.util.zip.ZipFile and you can only read JarFiles with it (although there are constructors that take a File object).
Since: 1.2
Field Summary | |
---|---|
static String | MANIFEST_NAME The name of the manifest entry: META-INF/MANIFEST.MF |
Constructor Summary | |
---|---|
JarFile(String fileName)
Creates a new JarFile. | |
JarFile(String fileName, boolean verify)
Creates a new JarFile. | |
JarFile(File file)
Creates a new JarFile. | |
JarFile(File file, boolean verify)
Creates a new JarFile. | |
JarFile(File file, boolean verify, int mode)
Creates a new JarFile with the indicated mode. |
Method Summary | |
---|---|
Enumeration<JarEntry> | entries()
Returns a enumeration of all the entries in the JarFile.
|
ZipEntry | getEntry(String name)
XXX
It actually returns a JarEntry not a zipEntry |
InputStream | getInputStream(ZipEntry entry)
Returns an input stream for the given entry. |
JarEntry | getJarEntry(String name)
Returns the JarEntry that belongs to the name if such an entry
exists in the JarFile. |
Manifest | getManifest()
Returns the manifest for this JarFile or null when the JarFile does not
contain a manifest file. |
getInputStream()
) to check its signature.
Parameters: fileName the name of the file to open
Throws: FileNotFoundException if the fileName cannot be found IOException if another IO exception occurs while reading
getInputStream()
) to check its signature.
Parameters: fileName the name of the file to open verify checks manifest and entries when true and a manifest exists, when false no checks are made
Throws: FileNotFoundException if the fileName cannot be found IOException if another IO exception occurs while reading
getInputStream()
) to check its signature.
Parameters: file the file to open as a jar file
Throws: FileNotFoundException if the file does not exits IOException if another IO exception occurs while reading
getInputStream()
) to check its signature.
Parameters: file the file to open to open as a jar file verify checks manifest and entries when true and a manifest exists, when false no checks are made
Throws: FileNotFoundException if file does not exist IOException if another IO exception occurs while reading
getInputStream()
) to check its signature.
manifest and if the manifest exists and verify is true verfies it.
Parameters: file the file to open to open as a jar file verify checks manifest and entries when true and a manifest exists, when false no checks are made mode either ZipFile.OPEN_READ or (ZipFile.OPEN_READ | ZipFile.OPEN_DELETE)
Throws: FileNotFoundException if the file does not exist IOException if another IO exception occurs while reading IllegalArgumentException when given an illegal mode
Since: 1.3
Throws: IllegalStateException when the JarFile is already closed
Parameters: name XXX
Parameters: entry The entry to get the input stream for.
Throws: ZipException XXX IOException XXX
getEntry
to a JarEntry.
Parameters: name the jar entry name to look up
Returns: the JarEntry if it exists, null otherwise