cytoscape.util
Class ZipMultipleFiles

java.lang.Object
  extended by cytoscape.util.ZipMultipleFiles

public class ZipMultipleFiles
extends Object

Zip multiple files into one. The created zip files can be decompressed by other utilities. Special Thanks for Mr. Masanori Kouno The original code was written by him. (http://www4.ocn.ne.jp/~mark44/TIPS/Java/ZipOutputStream/zip.htm)

Author:
kono

Constructor Summary
ZipMultipleFiles()
           
ZipMultipleFiles(String zipFile)
           
ZipMultipleFiles(String zipFile, String[] fileList)
           
ZipMultipleFiles(String zipFile, String[] fileList, File tempDir)
           
ZipMultipleFiles(String zipFile, String[] fileList, String tempDir)
           
ZipMultipleFiles(String zipFile, Writer[] entryList, String rootDir)
           
 
Method Summary
protected  void clean()
           
 void compress()
           
static InputStream readFile(String zipName, String fileNameRegEx)
          Reads a file contained within a zip file and returns an InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipMultipleFiles

public ZipMultipleFiles(String zipFile,
                        String[] fileList)

ZipMultipleFiles

public ZipMultipleFiles(String zipFile)

ZipMultipleFiles

public ZipMultipleFiles()

ZipMultipleFiles

public ZipMultipleFiles(String zipFile,
                        String[] fileList,
                        File tempDir)

ZipMultipleFiles

public ZipMultipleFiles(String zipFile,
                        String[] fileList,
                        String tempDir)

ZipMultipleFiles

public ZipMultipleFiles(String zipFile,
                        Writer[] entryList,
                        String rootDir)
Method Detail

clean

protected void clean()

compress

public void compress()

readFile

public static InputStream readFile(String zipName,
                                   String fileNameRegEx)
                            throws IOException
Reads a file contained within a zip file and returns an InputStream.

Parameters:
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.
Returns:
An InputStream of the zip entry identified by the regular expression or null if nothing matches.
Throws:
IOException