public class ZipReader extends Object
Constructor and Description |
---|
ZipReader(File file) |
ZipReader(File file,
int maxBuffer) |
ZipReader(InputStream inStream) |
ZipReader(InputStream inStream,
int maxBuffer) |
ZipReader(String fileName) |
Modifier and Type | Method and Description |
---|---|
void |
buffer() |
void |
close() |
protected void |
finalize() |
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!
|
Vector<ZipEntry> |
getMatchingEntries(String expr,
boolean sortName)
get entries by name - note that we need to buffer the entire file for this random access method
|
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
|
int |
getMaxBuffer() |
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
|
boolean |
setEntry(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(String rootEntry)
Setter for rootEntry attribute. use this to allow local searches relative to rootEntry
|
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
- maxBuffer
- public ZipReader(InputStream inStream, int maxBuffer)
inStream
- maxBuffer
- public ZipReader(File file)
file
- the file to readpublic ZipReader(File file, int maxBuffer)
file
- the file to readpublic ZipReader(String fileName)
fileName
- public int getMaxBuffer()
public void setMaxBuffer(int maxBuffer)
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 boolean setEntry(ZipEntry zeSet)
zeSet
- the zip entry to setpublic ZipEntry getMatchingEntry(String expr, int iSkip)
expr
- the regexp of the path (including directories) to match - simplified regexp is acceptediSkip
- how many to skip - default= 0public Vector<ZipEntry> getMatchingEntries(String expr, boolean sortName)
expr
- the regexp of the path (including directories) to match - simplified regexp is acceptedpublic 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 void close()
public String toString()
toString
in class Object
Object.toString()
Copyright © 2018. All rights reserved.