|
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.TarFilePacker
public class TarFilePacker
This class packs files into a TAR archive.
Field Summary | |
---|---|
private com.ice.tar.TarOutputStream |
tar
|
Constructor Summary | |
---|---|
TarFilePacker()
Creates a new TarFilePacker. |
Method Summary | |
---|---|
void |
close()
Finish the TAR 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 TarEntry and write the compressed
data to it. |
void |
setOutputStream(OutputStream out)
Wrap the output stream in a TarOutputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private com.ice.tar.TarOutputStream tar
Constructor Detail |
---|
public TarFilePacker()
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) throws IOException
TarOutputStream
.
setOutputStream
in interface FilePacker
out
- The output stream to write to
IOException
- If there is an error setting the output streampublic void pack(String entryName, InputStream in, long size, long lastModified) throws IOException
TarEntry
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 |