|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.zip.ZipFilePacker
public class ZipFilePacker
This class packs files into a ZIP archive.
Field Summary | |
---|---|
private ZipOutputStream |
zip
|
Constructor Summary | |
---|---|
ZipFilePacker()
Create a new packer that compresses files with the zip format. |
Method Summary | |
---|---|
void |
close()
Finish the ZIP file. |
String |
getDescription()
Get a short description of this file format that is suitable for display in selection list boxes. |
String |
getFileExtension()
Gets the extension that files, packed with this tool, should have, for example, zip or tar.gz Don't include the first
dot! |
String |
getMimeType()
Gets the MIME type to give compressed files from this packer |
void |
pack(String entryName,
InputStream in,
long size,
long lastModified)
Create a new ZipEntry and write the compressed
data to it. |
void |
setOutputStream(OutputStream out)
Wrap the output stream in a ZipOutputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ZipOutputStream zip
Constructor Detail |
---|
public ZipFilePacker()
Method Detail |
---|
public String getDescription()
FilePacker
getDescription
in interface FilePacker
public String getFileExtension()
FilePacker
zip
or tar.gz
Don't include the first
dot!
getFileExtension
in interface FilePacker
public String getMimeType()
FilePacker
getMimeType
in interface FilePacker
public void setOutputStream(OutputStream out)
ZipOutputStream
.
setOutputStream
in interface FilePacker
out
- The output stream to write topublic void pack(String entryName, InputStream in, long size, long lastModified) throws IOException
ZipEntry
and write the compressed
data to it.
pack
in interface FilePacker
entryName
- The name of the packed resource, including path
informationin
- The input stream to read uncompressed data from, or null
if the entry represents a directorysize
- The number of bytes of uncompressed datalastModified
- The time the contents was last modified, or 0
if not known
IOException
- If there are any errors when reading or writingpublic void close() throws IOException
close
in interface FilePacker
IOException
- If there are any errors
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |