public class ZipReader extends Object
| Constructor and Description |
|---|
ZipReader(File file) |
ZipReader(InputStream inStream) |
ZipReader(String fileName) |
| Modifier and Type | Method and Description |
|---|---|
void |
buffer() |
Vector<ZipEntry> |
getEntries()
get the vector of zip entries
|
ZipEntry |
getEntry(String urlString)
get an entry by name - note that we need to buffer the entire file for this random access method
|
static String |
getEntryName(ZipEntry ze)
retrieves the name and replaces any '\' with '/' and removes any spurious '.' or '..' in the path
|
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!
|
ZipEntry |
getMatchingEntry(String expr,
int iSkip)
get an entry by name - note that we need to buffer the entire file for this random access method
|
ZipEntry |
getNextEntry()
get the next entry - this can be used in non-buffered mode
returns null in case of snafu
|
ZipEntry |
getNextMatchingEntry(String expr)
get the next entry by expression - note that we need to buffer the entire file for this random access method
|
String |
getRootEntry()
Getter for rootEntry name attribute.
|
XMLDoc |
getXMLDoc()
get the xmlDoc of the current entry - note not threadsafe!
|
static ZipReader |
getZipReader(File jarFile) |
static ZipReader |
getZipReader(InputStream is)
get a zip reader that searches itself for a valid zip header
|
static Vector<ZipReader> |
getZipReaders(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
|
void |
setRootEntry(String rootEntry)
Setter for rootEntry attribute.
|
String |
toString() |
int |
unPack(File dir)
unpack into a directory
|
boolean |
unPack(File dir,
ZipEntry ze)
unpack an individual entry into a directory
|
public ZipReader(InputStream inStream)
inStream - public ZipReader(File file)
file - the file to readpublic ZipReader(String fileName)
fileName - public String getRootEntry()
public void setRootEntry(String rootEntry)
rootEntry - the rootEntry to setpublic boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive - public ZipEntry getNextEntry()
public int unPack(File dir)
dir - the destination directorypublic boolean unPack(File dir, ZipEntry ze)
dir - ze - public static String getEntryName(ZipEntry ze)
ze - public static ZipReader getZipReader(InputStream is)
is - public static Vector<ZipReader> getZipReaders(InputStream is, int max)
is - public ZipEntry getEntry(String urlString)
urlString - the file path (case sensitive)public ZipEntry getMatchingEntry(String expr, int iSkip)
expr - the regexp to match - simplified regexp is acceptediSkip - how many to skip - default= 0public ZipEntry getNextMatchingEntry(String expr)
expr - the regexp to match - simplified regexp is acceptedpublic InputStream getInputStream()
public XMLDoc getXMLDoc()
public JDFDoc getJDFDoc()
public void buffer()
public String toString()
toString in class ObjectObject.toString()Copyright © 2015. All rights reserved.