public class Bzip2FilePacker extends TarFilePacker
TarFilePacker
in a BZIP2 stream, creating
a tar.bz2 file.Modifier and Type | Field and Description |
---|---|
private org.apache.tools.bzip2.CBZip2OutputStream |
bzip |
Constructor and Description |
---|
Bzip2FilePacker()
Create a new packer that compresses files with the BZIP2 format.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Finish the BZIP stream.
|
java.lang.String |
getDescription()
Get a short description of this file format that is suitable for display in
selection list boxes.
|
java.lang.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! |
java.lang.String |
getMimeType()
Gets the MIME type to give compressed files from this packer
|
void |
setOutputStream(java.io.OutputStream out)
Wrap the output stream in a
GZIPOutputStream . |
pack
public Bzip2FilePacker()
public java.lang.String getDescription()
FilePacker
getDescription
in interface FilePacker
getDescription
in class TarFilePacker
public java.lang.String getFileExtension()
FilePacker
zip
or tar.gz
Don't include the first
dot!getFileExtension
in interface FilePacker
getFileExtension
in class TarFilePacker
public java.lang.String getMimeType()
FilePacker
getMimeType
in interface FilePacker
getMimeType
in class TarFilePacker
public void setOutputStream(java.io.OutputStream out) throws java.io.IOException
GZIPOutputStream
.setOutputStream
in interface FilePacker
setOutputStream
in class TarFilePacker
out
- The output stream to write tojava.io.IOException
- If there is an error setting the output streampublic void close() throws java.io.IOException
close
in interface FilePacker
close
in class TarFilePacker
java.io.IOException
- If there are any errors