|
Cytoscape 2.4.1 (c) 2006,2007 ISB, MSKCC, UCSD | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.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 InputStream |
readFile(String zipName,
String fileNameRegEx)
Reads a file contained within a zip file and returns an InputStream. |
void |
setPluginFileMap(HashMap pMap)
|
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)
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
|
www.cytoscape.org | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |