|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dmonix.util.zip.ZipWriter
Class for writing/deflating entries to a ZIP file.
Copyright: Copyright (c) 2001
Company: dmonix.org
| Method Summary | |
void |
addFile(java.io.File file)
Add a new file entry to the existing zip file. |
void |
addFile(java.io.File file,
java.io.File directory)
Add a new file entry to the existing zip file. |
void |
addFile(java.io.File file,
java.io.File directory,
java.lang.String comment)
Add a new file entry to the existing zip file. |
void |
addFile(java.io.File file,
java.lang.String comment)
Add a new file entry to the existing zip file. |
void |
addFile(java.lang.String fileName)
Add a new file entry to the existing zip file The method will add the file to zip file with no information on the original files source path. |
void |
addFile(java.lang.String fileName,
java.lang.String comment)
Add a new file entry to the existing zip file The method will implicitly perform an addZipEntry and a closeZipEntry. |
void |
addFiles(java.io.File[] files)
Add an array of files to the existing zip file. |
void |
addZipEntry(java.lang.String name)
Creates a new entry in the ZIP file. |
void |
addZipEntry(java.lang.String name,
java.lang.String comment)
Creates a new entry in the ZIP file. |
void |
close()
Close the outputstream to the zip file. |
void |
closeZipEntry()
Closes the current zip entry. |
static ZipWriter |
createZipFile(java.io.File file)
Creates a new ZIP file. |
static ZipWriter |
createZipFile(java.io.File file,
int compressionLevel)
Creates a new ZIP file. |
static ZipWriter |
createZipFile(java.lang.String fileName)
Creates a new ZIP file. |
static ZipWriter |
createZipFile(java.lang.String fileName,
int compressionLevel)
Creates a new ZIP file. |
void |
setCompressionLevel(int compressionLevel)
Sets the level of compression. |
void |
setZipfileComment(java.lang.String comment)
Set a comment for the current ZIP file. |
void |
writeDataToZipEntry(byte[] data)
Writes data to the current entry. |
void |
writeDataToZipEntry(byte[] data,
int offset,
int length)
Writes data to the current entry. |
void |
writeDataToZipEntry(java.io.InputStream istream,
boolean closeInputStream)
Copies data from the provided stream to the current entry A call to addZipEntry must preceed this operation. |
void |
writeDataToZipEntry(int data)
Writes data to the current entry. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public void addFile(java.io.File file,
java.io.File directory)
throws java.io.IOException
addZipEntry and a closeZipEntry.
file - A file objectdirectory - A parent directory
java.io.IOExceptionorg.dmonix.io.IOUtil.getRelativePath(File, File)
public void addFile(java.io.File file)
throws java.io.IOException
addZipEntry and a closeZipEntry.
file - The file
java.io.IOException
public void addFile(java.lang.String fileName)
throws java.io.IOException
addZipEntry and a closeZipEntry.
fileName - name/path of the file to add
java.io.IOException
public void addFile(java.io.File file,
java.io.File directory,
java.lang.String comment)
throws java.io.IOException
addZipEntry and a closeZipEntry.
file - A file objectdirectory - A parent directorycomment - The entry comment
java.io.IOExceptionorg.dmonix.io.IOUtil.getRelativePath(File, File)
public void addFile(java.io.File file,
java.lang.String comment)
throws java.io.IOException
addZipEntry and a closeZipEntry.
file - The filecomment - The entry comment
java.io.IOException
public void addFile(java.lang.String fileName,
java.lang.String comment)
throws java.io.IOException
addZipEntry and a closeZipEntry.
fileName - name/path of the file to addcomment - The entry comment
java.io.IOException
public void addFiles(java.io.File[] files)
throws java.io.IOException
addFile(File)
files - The files to add
java.io.IOExceptionaddFile(File)
public void addZipEntry(java.lang.String name)
throws java.io.IOException
name - The name/path of the entry
java.io.IOException
public void addZipEntry(java.lang.String name,
java.lang.String comment)
throws java.io.IOException
name - The name/path of the entrycomment - The entry comment
java.io.IOException
public void writeDataToZipEntry(int data)
throws java.io.IOException
addZipEntry must preceed this operation.
data - The data to write to the entry
java.io.IOExceptionaddZipEntry(String),
addZipEntry(String, String)
public void writeDataToZipEntry(byte[] data)
throws java.io.IOException
addZipEntry must preceed this operation.
data - The data to write to the entry
java.io.IOExceptionaddZipEntry(String),
addZipEntry(String, String)
public void writeDataToZipEntry(byte[] data,
int offset,
int length)
throws java.io.IOException
addZipEntry must preceed this operation.
data - The data to write to the entryoffset - The offset from where to start read data in the data arraylength - The amount of data to read from the data array
java.io.IOExceptionaddZipEntry(String),
addZipEntry(String, String)
public void writeDataToZipEntry(java.io.InputStream istream,
boolean closeInputStream)
throws java.io.IOException
addZipEntry must preceed this operation.
istream - The inputstrream from where to copy datacloseInputStream - If the inputstream is to be closed
java.io.IOExceptionaddZipEntry(String),
addZipEntry(String, String)
public void closeZipEntry()
throws java.io.IOException
addZipEntry must preceed this operation.
java.io.IOExceptionaddZipEntry(String),
addZipEntry(String, String)
public void close()
throws java.io.IOException
java.io.IOExceptionpublic void setCompressionLevel(int compressionLevel)
compressionLevel - The compression level [0-9]public void setZipfileComment(java.lang.String comment)
comment - The ZIP file comment
public static ZipWriter createZipFile(java.io.File file)
throws java.io.IOException
file - The ZIP file
java.io.IOException
public static ZipWriter createZipFile(java.io.File file,
int compressionLevel)
throws java.io.IOException
file - The ZIP filecompressionLevel - The compression level [0-9]
java.io.IOException
public static ZipWriter createZipFile(java.lang.String fileName)
throws java.io.IOException
fileName - Name of the zip file
java.io.IOException
public static ZipWriter createZipFile(java.lang.String fileName,
int compressionLevel)
throws java.io.IOException
fileName - Name of the zip filecompressionLevel - The compression level [0-9]
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||