public class NpJarFile extends JarFile
| Modifier and Type | Field and Description |
|---|---|
static int |
CENATT |
static int |
CENATX |
static int |
CENCOM |
static int |
CENCRC |
static int |
CENDSK |
static int |
CENEXT |
static int |
CENFLG |
static int |
CENHDR |
static int |
CENHOW |
static int |
CENLEN |
static int |
CENNAM |
static int |
CENOFF |
static long |
CENSIG |
static int |
CENSIZ |
static int |
CENTIM |
static int |
CENVEM |
static int |
CENVER |
static int |
ENDCOM |
static int |
ENDHDR |
static int |
ENDOFF |
static long |
ENDSIG |
static int |
ENDSIZ |
static int |
ENDSUB |
static int |
ENDTOT |
static int |
EXTCRC |
static int |
EXTHDR |
static int |
EXTLEN |
static long |
EXTSIG |
static int |
EXTSIZ |
static int |
LOCCRC |
static int |
LOCEXT |
static int |
LOCFLG |
static int |
LOCHDR |
static int |
LOCHOW |
static int |
LOCLEN |
static int |
LOCNAM |
static long |
LOCSIG |
static int |
LOCSIZ |
static int |
LOCTIM |
static int |
LOCVER |
MANIFEST_NAMEOPEN_DELETE, OPEN_READ| Constructor and Description |
|---|
NpJarFile(File file)
Loads or opens the JAR file "inMemory", without "winStyle", but with "verify".
|
NpJarFile(File file,
boolean inMemory,
boolean winStyle,
boolean verify)
Loads or opens the JAR file.
|
NpJarFile(String name)
Loads or opens the JAR file "inMemory", without "winStyle", but with "verify".
|
NpJarFile(String name,
boolean inMemory,
boolean winStyle,
boolean verify)
Loads or opens the JAR file.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clearLoadedFilesList()
Clears the loaded files list.
|
Enumeration<JarEntry> |
entries()
Returns an enumeration of the zip file entries.
|
ZipEntry |
getEntry(String name)
Gets the ZIP entry with the specified name.
|
byte[] |
getEntryData(String name)
Gets the byte [] data for an entry if present.
|
byte[] |
getEntryData(ZipEntry ze)
Gets the byte [] data for an entry if present.
|
InputStream |
getInputStream(ZipEntry ze)
Returns an input stream for reading the contents of the specified zip file entry.
|
JarEntry[] |
getJarEntries()
Gets all Jar entries.
|
JarEntry |
getJarEntry(String name)
Gets the JAR entry with the specified name.
|
Manifest |
getManifest()
Returns the jar file manifest, or
null if none. |
static NpJarFile |
getNpJarFile(File file)
Loads the requested NpJarFile or grabs one from the table of loaded files and reloads
it as required.
|
static NpJarFile |
getNpJarFile(String fileName)
Loads the requested NpJarFile or grabs one from the table of loaded files and reloads
it as required.
|
boolean |
hasChanged()
Checks if the Jar file has changed since last call to this method,
i.e.
|
int |
size()
Returns the number of entries in the Jar file.
|
close, finalize, getComment, getNamepublic static final long LOCSIG
public static final long EXTSIG
public static final long CENSIG
public static final long ENDSIG
public static final int LOCHDR
public static final int EXTHDR
public static final int CENHDR
public static final int ENDHDR
public static final int LOCVER
public static final int LOCFLG
public static final int LOCHOW
public static final int LOCTIM
public static final int LOCCRC
public static final int LOCSIZ
public static final int LOCLEN
public static final int LOCNAM
public static final int LOCEXT
public static final int EXTCRC
public static final int EXTSIZ
public static final int EXTLEN
public static final int CENVEM
public static final int CENVER
public static final int CENFLG
public static final int CENHOW
public static final int CENTIM
public static final int CENCRC
public static final int CENSIZ
public static final int CENLEN
public static final int CENNAM
public static final int CENEXT
public static final int CENCOM
public static final int CENDSK
public static final int CENATT
public static final int CENATX
public static final int CENOFF
public static final int ENDSUB
public static final int ENDTOT
public static final int ENDSIZ
public static final int ENDOFF
public static final int ENDCOM
public NpJarFile(String name) throws IOException
name - the file name.IOExceptionpublic NpJarFile(File file) throws IOException
file - the file.IOExceptionpublic NpJarFile(String name, boolean inMemory, boolean winStyle, boolean verify) throws IOException
name - the file name.inMemory - if true, the entire Jar file is loaded into memory and then closed. Subsequent operations can be
performed as normal.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.verify - if the Jar file should be verified.IOExceptionpublic NpJarFile(File file, boolean inMemory, boolean winStyle, boolean verify) throws IOException
name - the file name.inMemory - if true, the entire Jar file is loaded into memory and then closed. Subsequent operations can be
performed as normal.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.verify - if the Jar file should be verified.IOExceptionpublic static void clearLoadedFilesList()
public static NpJarFile getNpJarFile(String fileName) throws IOException
IOException - for file failures.public static NpJarFile getNpJarFile(File file) throws IOException
IOException - for file failures.public boolean hasChanged()
public Enumeration<JarEntry> entries()
public InputStream getInputStream(ZipEntry ze) throws IOException
getInputStream in class JarFileZipException - if a zip file format error has occurred.IOException - if an I/O error has occurred.SecurityException - if any of the jar file entries are incorrectly signed.IllegalStateException - may be thrown if the jar file has been closed.public JarEntry getJarEntry(String name)
getJarEntry in class JarFilepublic int size()
size in class ZipFileIllegalStateException - if the Jar file has been closed.public Manifest getManifest() throws IOException
null if none.getManifest in class JarFilenull if none.IllegalStateException - may be thrown if the jar file has been closedIOExceptionpublic byte[] getEntryData(String name)
name - the name of the entry.public byte[] getEntryData(ZipEntry ze)
name - the name of the entry.public JarEntry[] getJarEntries()
Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2013. All rights reserved.