|
Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cytoscape.util.ZipUtil
public class ZipUtil
Compression-related methods mainly for Session Writer.
The created zip files can be decompressed by any zip utilities.
CytoscapeSessionWriter
Field Summary | |
---|---|
static int |
DEF_COMPRESSION_LEVEL
|
Constructor Summary | |
---|---|
ZipUtil(String zipFile,
String[] fileNameList,
String sessionDir)
Constructor. |
|
ZipUtil(String zipFile,
String[] fileNameList,
String sessionDir,
String fileDir)
Constructor. |
Method Summary | |
---|---|
void |
compressFast(int compressionLevel,
boolean cleanFlag)
Faster version of compression method. |
static List<ZipEntry> |
getAllFiles(String zipName,
String fileNameRegEx)
Reads zip file, returns a list of all entries that match the given regular expression |
static InputStream |
readFile(String zipName,
String fileNameRegEx)
Reads a file contained within a zip file and returns an InputStream for the specific file you want from within the zip file. |
void |
setPluginFileMap(HashMap pMap)
DOCUMENT ME! |
static List<String> |
unzip(String zipName,
String unzipDir,
TaskMonitor taskMonitor)
Unzips the given zip file and returns a list of all files unzipped |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEF_COMPRESSION_LEVEL
Constructor Detail |
---|
public ZipUtil(String zipFile, String[] fileNameList, String sessionDir)
zipFile
- Output zip file name.fileNameList
- List of file names to be compressed.sessionDir
- Root dir created in the zip archive.public ZipUtil(String zipFile, String[] fileNameList, String sessionDir, String fileDir)
zipFile
- Output zip file name.fileNameList
- List of file names to be compressed.sessionDir
- Root dir created in the zip archive.fileDir
- root directory of files in fileList.Method Detail |
---|
public void compressFast(int compressionLevel, boolean cleanFlag) throws IOException
compressionLevel
- Level of compression. Range = 0-9. 0 is no-compression, and 9
is most space-efficeint. However, 9 is slow.cleanFlag
- If true, remove all imput files.
IOException
public void setPluginFileMap(HashMap pMap)
pMap
- DOCUMENT ME!public static InputStream readFile(String zipName, String fileNameRegEx) throws IOException
zipName
- The name of the zip file to read.fileNameRegEx
- A regular expression that identifies the file to be read. In
general this should just be the file name you're looking for.
If more than one file matches the regular expression, only the
first will be returned. If you're looking for a specific file
remeber to build your regular expression correctly. For
example, if you're looking for the file 'vizmap.props', make
your regular expression '.*vizmap.props' to accomodate any
clutter from the zip file.
IOException
public static List<ZipEntry> getAllFiles(String zipName, String fileNameRegEx) throws IOException
zipName
- fileNameRegEx
-
IOException
public static List<String> unzip(String zipName, String unzipDir, TaskMonitor taskMonitor) throws IOException
is
- InputStream for a zip file
IOException
|
www.cytoscape.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |