public interface FilePacker
PackedFileExporter
plug-in. Each class should
be registered in a PluginConfiguration
for the
PackedFileExporter
.Modifier and Type | Method and Description |
---|---|
void |
close()
End the packing and close.
|
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 |
pack(java.lang.String entryName,
java.io.InputStream in,
long size,
long lastModified)
Compress the uncompressed input stream to an entry with the given
name into the outputstream.
|
void |
setOutputStream(java.io.OutputStream out)
The output stream that the compressed files should be written to.
|
java.lang.String getDescription()
java.lang.String getFileExtension()
zip
or tar.gz
Don't include the first
dot!java.lang.String getMimeType()
void setOutputStream(java.io.OutputStream out) throws java.io.IOException
out
- The output stream to write tojava.io.IOException
- If there is an error setting the output streamvoid pack(java.lang.String entryName, java.io.InputStream in, long size, long lastModified) throws java.io.IOException
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 knownjava.io.IOException
- If there are any errors when reading or writingvoid close() throws java.io.IOException
setOutputStream(OutputStream)
method, and
cleanup temporary objects.java.io.IOException
- If there are any errors