public class ZipReader
extends java.lang.Object
| Constructor and Description |
|---|
ZipReader(java.io.File file) |
ZipReader(java.io.File file,
int maxBuffer) |
ZipReader(java.io.InputStream inStream) |
ZipReader(java.io.InputStream inStream,
int maxBuffer) |
ZipReader(java.lang.String fileName) |
| Modifier and Type | Method and Description |
|---|---|
void |
buffer() |
void |
close() |
java.util.Vector<java.util.zip.ZipEntry> |
getEntries()
get the vector of zip entries
|
java.util.zip.ZipEntry |
getEntry(java.lang.String urlString)
get an entry by name - note that we need to buffer the entire file for this random access method
|
static java.lang.String |
getEntryName(java.util.zip.ZipEntry ze)
retrieves the name and replaces any '\' with '/' and removes any spurious '.' or '..' in the path
|
java.io.InputStream |
getInputStream()
get the stream to read this from; note that we must close manually
|
JDFDoc |
getJDFDoc()
get the xmlDoc of the current entry - note not threadsafe!
|
java.util.Vector<java.util.zip.ZipEntry> |
getMatchingEntries(java.lang.String expr,
boolean sortName)
get entries by name - note that we need to buffer the entire file for this random access method
|
java.util.zip.ZipEntry |
getMatchingEntry(java.lang.String expr,
int iSkip)
get an entry by name - note that we need to buffer the entire file for this random access method
|
int |
getMaxBuffer() |
java.util.zip.ZipEntry |
getNextEntry()
get the next entry - this can be used in non-buffered mode returns null in case of snafu
|
java.util.zip.ZipEntry |
getNextMatchingEntry(java.lang.String expr)
get the next entry by expression - note that we need to buffer the entire file for this random access method
|
java.lang.String |
getRootEntry()
Getter for rootEntry name attribute.
|
XMLDoc |
getXMLDoc()
get the xmlDoc of the current entry - note not threadsafe!
|
static ZipReader |
getZipReader(java.io.File jarFile) |
static ZipReader |
getZipReader(java.io.File jarFile,
boolean search) |
static ZipReader |
getZipReader(java.io.InputStream is)
get a zip reader that searches itself for a valid zip header
|
static ZipReader |
getZipReader(java.io.InputStream is,
boolean bSearch)
get a zip reader that searches itself for a valid zip header
|
static java.util.Vector<ZipReader> |
getZipReaders(java.io.InputStream is,
int max)
get a zip reader that searches itself for a valid zip header
|
boolean |
isCaseSensitive()
return true if all checks are cese sensitive (the default)
|
void |
setCaseSensitive(boolean caseSensitive)
set the case sensitivity for matching strings and regexp
|
boolean |
setEntry(java.util.zip.ZipEntry zeSet)
get an entry by name - note that we need to buffer the entire file for this random access method
|
void |
setMaxBuffer(int maxBuffer) |
void |
setRootEntry(java.lang.String rootEntry)
Setter for rootEntry attribute.
|
java.lang.String |
toString() |
int |
unPack(java.io.File dir)
unpack into a directory
|
boolean |
unPack(java.io.File dir,
java.util.zip.ZipEntry ze)
unpack an individual entry into a directory
|
public ZipReader(java.io.InputStream inStream)
inStream - maxBuffer - public ZipReader(java.io.InputStream inStream,
int maxBuffer)
inStream - maxBuffer - public ZipReader(java.io.File file)
file - the file to readpublic ZipReader(java.io.File file,
int maxBuffer)
file - the file to readpublic ZipReader(java.lang.String fileName)
fileName - public int getMaxBuffer()
public void setMaxBuffer(int maxBuffer)
public java.lang.String getRootEntry()
public void setRootEntry(java.lang.String rootEntry)
rootEntry - the rootEntry to setpublic boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive - public java.util.Vector<java.util.zip.ZipEntry> getEntries()
public java.util.zip.ZipEntry getNextEntry()
public int unPack(java.io.File dir)
dir - the destination directorypublic boolean unPack(java.io.File dir,
java.util.zip.ZipEntry ze)
dir - ze - public static java.lang.String getEntryName(java.util.zip.ZipEntry ze)
ze - public static ZipReader getZipReader(java.io.InputStream is)
is - public static ZipReader getZipReader(java.io.InputStream is, boolean bSearch)
is - public static java.util.Vector<ZipReader> getZipReaders(java.io.InputStream is, int max)
is - public java.util.zip.ZipEntry getEntry(java.lang.String urlString)
urlString - the file path (case sensitive)public boolean setEntry(java.util.zip.ZipEntry zeSet)
zeSet - the zip entry to setpublic java.util.zip.ZipEntry getMatchingEntry(java.lang.String expr,
int iSkip)
expr - the regexp of the path (including directories) to match - simplified regexp is acceptediSkip - how many to skip - default= 0public java.util.Vector<java.util.zip.ZipEntry> getMatchingEntries(java.lang.String expr,
boolean sortName)
expr - the regexp of the path (including directories) to match - simplified regexp is acceptedpublic java.util.zip.ZipEntry getNextMatchingEntry(java.lang.String expr)
expr - the regexp to match - simplified regexp is acceptedpublic java.io.InputStream getInputStream()
public XMLDoc getXMLDoc()
public JDFDoc getJDFDoc()
public void buffer()
public void close()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public static ZipReader getZipReader(java.io.File jarFile)
jarFile - public static ZipReader getZipReader(java.io.File jarFile, boolean search)
jarFile -