API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.jar. JarFile View Source
Author(s)
David Connelly
Since
1.2
Version
1.67, 04/07/06
Serial
Hierarchy
 Object
      ZipFile
          JarFile
Implements
Subclasses
Description
public class JarFile
  The JarFile class is used to read the contents of a jar file from any file that can be opened with java.io.RandomAccessFile.
See also:    Manifest ZipFile JarEntry
Constructors
public JarFile (File file) throws IOException
  Creates a new JarFile to read from the specified File object.
public JarFile (File file, boolean verify) throws IOException
  Creates a new JarFile to read from the specified File object.
public JarFile (File file, boolean verify, int mode) throws IOException
  Creates a new JarFile to read from the specified File object in the specified mode.
public JarFile (String name) throws IOException
  Creates a new JarFile to read from the specified file name.
public JarFile (String name, boolean verify) throws IOException
  Creates a new JarFile to read from the specified file name.
Methods
Hide/Show inherited methods
public void close () throws IOException [Inherited From ZipFile]
  Closes the ZIP file.
public Enumeration<JarEntry> entries () [Overrides ZipFile]
Returns an enumeration of the zip file entries.
protected void finalize () throws IOException [Inherited From ZipFile]
  Ensures that the close method of this ZIP file is called when there are no more references to it.
public ZipEntry getEntry (String name) [Overrides ZipFile]
  Returns the ZipEntry for the given entry name or null if not found.
publicsynchronized InputStream getInputStream (ZipEntry ze) throws IOException [Overrides ZipFile]
  Returns an input stream for reading the contents of the specified zip file entry.
public JarEntry getJarEntry (String name)
  Returns the JarEntry for the given entry name or null if not found.
public Manifest getManifest () throws IOException
  Returns the jar file manifest, or null if none.
public String getName () [Inherited From ZipFile]
  Returns the path name of the ZIP file.
pack-private boolean hasClassPathAttribute () throws IOException
public int size () [Inherited From ZipFile]
  Returns the number of entries in the ZIP file.
Fields
Hide/Show inherited fields
publicfinalstatic String MANIFEST_NAME = "META-INF/MANIFEST.MF"
The JAR manifest file name.
publicfinalstatic int OPEN_DELETE = "4" [Inherited From ZipFile]
  Mode flag to open a zip file and mark it for deletion.
publicfinalstatic int OPEN_READ = "1" [Inherited From ZipFile]
Mode flag to open a zip file for reading.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar