public class MemoryJarFile 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| Modifier and Type | Method and Description |
|---|---|
static MemoryJarFile |
createJarFile(File file,
boolean verify,
boolean winStyle,
MemoryJarFileDecrypter streamDecrypter,
MemoryJarFileDecrypter entryDecrypter)
Creates a memory Jar file.
|
static MemoryJarFile |
createJarFile(InputStream in,
boolean verify,
boolean winStyle,
MemoryJarFileDecrypter streamDecrypter,
MemoryJarFileDecrypter entryDecrypter)
Creates a memory Jar file.
|
static MemoryJarFile |
createJarFile(JarInputStream jin)
Creates a memory Jar file.
|
static MemoryJarFile |
createJarFile(JarInputStream jin,
boolean winStyle)
Creates a memory Jar file.
|
static MemoryJarFile |
createJarFile(JarInputStream jin,
boolean winStyle,
MemoryJarFileDecrypter decrypter)
Creates a memory Jar file.
|
static MemoryJarFile |
createJarFile(String fileName,
boolean verify,
boolean winStyle,
MemoryJarFileDecrypter streamDecrypter,
MemoryJarFileDecrypter entryDecrypter)
Creates a memory Jar file.
|
Enumeration<JarEntry> |
entries()
Returns an enumeration of the Jar file entries.
|
byte[] |
getByteArray(ZipEntry ze)
Returns the byte array of the contents of the specified zip file entry.
|
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 |
getJarEntry(String name)
Gets the Jar entry with the specified name.
|
Manifest |
getManifest()
Returns the Jar file manifest, or
null if none. |
String |
getName()
Gets the name of the Jar file.
|
void |
setName(String name)
Sets the name of the Jar file.
|
int |
size()
Returns the number of entries in the Jar file.
|
close, finalize, getCommentpublic 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 static MemoryJarFile createJarFile(JarInputStream jin) throws IOException
jin - the Jar input stream.IOExceptionpublic static MemoryJarFile createJarFile(JarInputStream jin, boolean winStyle) throws IOException
jin - the Jar input stream.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.IOExceptionpublic static MemoryJarFile createJarFile(JarInputStream jin, boolean winStyle, MemoryJarFileDecrypter decrypter) throws IOException
jin - the Jar input stream.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.decrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of an entry.IOExceptionpublic static MemoryJarFile createJarFile(InputStream in, boolean verify, boolean winStyle, MemoryJarFileDecrypter streamDecrypter, MemoryJarFileDecrypter entryDecrypter) throws IOException
in - an input stream.verify - set to true to verify the Jar file for correctness.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.streamDecrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of the entire input stream data, set to null for no decryption.entryDecrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of an entry, set to null for no decryption.IOExceptionpublic static MemoryJarFile createJarFile(File file, boolean verify, boolean winStyle, MemoryJarFileDecrypter streamDecrypter, MemoryJarFileDecrypter entryDecrypter) throws IOException
file - the Jar File instance to read.verify - set to true to verify the Jar file for correctness.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.streamDecrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of the entire input stream data, set to null for no decryption.entryDecrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of an entry, set to null for no decryption.IOExceptionpublic static MemoryJarFile createJarFile(String fileName, boolean verify, boolean winStyle, MemoryJarFileDecrypter streamDecrypter, MemoryJarFileDecrypter entryDecrypter) throws IOException
fileName - the file name of Jar file to read.verify - set to true to verify the Jar file for correctness.winStyle - if true, the entries are case insensitive and backslash can be used with forward slash as well.streamDecrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of the entire input stream data, set to null for no decryption.entryDecrypter - an instance of a class implementing the MemoryJarFileDecrypter interface to provide
decryption of an entry, set to null for no decryption.IOExceptionpublic Enumeration<JarEntry> entries()
public InputStream getInputStream(ZipEntry ze) throws FileNotFoundException
getInputStream in class JarFileFileNotFoundException - if the entry isn't found.public byte[] getByteArray(ZipEntry ze) throws FileNotFoundException
FileNotFoundException - if the entry isn't found.public JarEntry getJarEntry(String name)
getJarEntry in class JarFilename - name of the Jar entry, 'winStyle' parameter applies, i.e. '\' is translated
to '/' and the name check is done case insensitive.public int size()
public Manifest getManifest()
null if none.getManifest in class JarFilenull if none.public String getName()
setName,
the "real" temporary Jar file name from the temporary directory is returned.public void setName(String name)
getName method will return that name
(if non-null), or the "real" temporary Jar file name from the temporary directory if the
name parameter is null.name - the name of the Jar file or null to reset it to the "real" temporary Jar file.public byte[] getEntryData(String name)
name - the name of the entry.public byte[] getEntryData(ZipEntry ze)
name - the name of the entry.Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.