java.util.jar
public
class
java.util.jar.JarFile
JarFile is used to read jar entries and their associated data from jar files.
Summary
Constants
CENATT,
CENATX,
CENCOM,
CENCRC,
CENDSK,
CENEXT,
CENFLG,
CENHDR,
CENHOW,
CENLEN,
CENNAM,
CENOFF,
CENSIG,
CENSIZ,
CENTIM,
CENVEM,
CENVER,
ENDCOM,
ENDHDR,
ENDOFF,
ENDSIG,
ENDSIZ,
ENDSUB,
ENDTOT,
EXTCRC,
EXTHDR,
EXTLEN,
EXTSIG,
EXTSIZ,
LOCCRC,
LOCEXT,
LOCFLG,
LOCHDR,
LOCHOW,
LOCLEN,
LOCNAM,
LOCSIG,
LOCSIZ,
LOCTIM,
LOCVER,
OPEN_DELETE,
OPEN_READ
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
public
static
final
String
MANIFEST_NAME
Constant Value:
"META-INF/MANIFEST.MF"
Public Constructors
public
JarFile(File file)
Create a new JarFile using the contents of file.
public
JarFile(File file, boolean verify)
Create a new JarFile using the contents of file.
Parameters
file
| java.io.File |
verify
| verify a signed jar file |
public
JarFile(File file, boolean verify, int mode)
Create a new JarFile using the contents of file.
Parameters
file
| java.io.File |
verify
| verify a signed jar file |
mode
| the mode to use, either OPEN_READ or OPEN_READ | OPEN_DELETE |
public
JarFile(String filename)
Create a new JarFile from the contents of the file specified by filename.
Parameters
filename
| java.lang.String |
public
JarFile(String filename, boolean verify)
Create a new JarFile from the contents of the file specified by filename.
Parameters
filename
| java.lang.String |
verify
| verify a signed jar file |
Public Methods
public
void
close()
Close the Zip file.
This could be called multiple times, e.g. once explicitly and again
by the finalizer.
The Java doc doesn't say anything about what operations like
entries() or getName() are supposed to do after the file is closed.
Return an enumeration containing the JarEntrys contained in this JarFile.
Return the JarEntry specified by name or null if no such entry exists
Parameters
name
| the name of the entry in the jar file |
Return an InputStream for reading the decompressed contents of ze.
Parameters
ze
| the ZipEntry to read from |
Throws
IOException
| If an error occured while creating the InputStream.
|
Return the JarEntry specified by name or null if no such entry exists.
Parameters
name
| the name of the entry in the jar file |
public
Manifest
getManifest()
Returns the Manifest object associated with this JarFile or null if no
manifest entry exists.