|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--corpus.fileIO.Zip
http://www.javaworld.com/javaworld/jw-11-1998/jw-11-howto-p2.html
ZipInfo
,
Unzip
,
FileIO.object_to_byteA_zip(Object)
Constructor Summary | |
Zip(java.io.OutputStream ps)
The zipfile will be written to the supplied OutputStream |
|
Zip(java.lang.String[] paths,
java.lang.String zipfilename)
Given an array of file paths, this constructor will create a zipfile containing them and write it out to the filename. |
Method Summary | |
void |
add(byte[] data,
java.lang.String name,
long lastModified)
Adds a single new entry to the current Zip File. |
void |
add(java.lang.Object object,
java.lang.String name)
Compresses and object into the current zip file. |
void |
add(java.lang.String path)
Adds a new entry to the Zip File. |
void |
close()
Should be done after all entries have been added. |
static byte[] |
compress(byte[] data)
Given a byte array will return a zip compressed version. |
static void |
compressDirectory(Directory dir)
Will compress all the files in a directory and store them in a zip file in the directories parent. |
static void |
main(java.lang.String[] rgstring)
Run some tests and examples. |
void |
setup()
Create the ZipOutputStream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Zip(java.io.OutputStream ps)
public Zip(java.lang.String[] paths, java.lang.String zipfilename) throws java.io.FileNotFoundException
paths
- the string array of file paths to compresszipfilename
- the name of the file to output to. .zip will automagically be appended.Method Detail |
public static void compressDirectory(Directory dir)
dir
- Path to the directory to compress.public void setup()
public void add(java.lang.String path) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public void add(java.lang.Object object, java.lang.String name) throws java.io.IOException
object
- The object to compressname
- The name of the object
java.io.IOException
public void add(byte[] data, java.lang.String name, long lastModified) throws java.io.IOException
data
- The data to be compressed in the zip file.name
- The name to assign to the datalastModified
- When the data was last modified
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public static byte[] compress(byte[] data) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] rgstring) throws java.lang.Exception
java.lang.Exception
|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |