public abstract static class Output.MultiOutput extends Output implements java.lang.AutoCloseable
Output.ArchiveMultiOutput, Output.FolderMultiOutput, Output.MultiOutput, Output.PathArchiveMultiOutput, Output.PipeArchiveMultiOutput, Output.SingleOutput| Constructor and Description |
|---|
MultiOutput() |
| Modifier and Type | Method and Description |
|---|---|
static Output.MultiOutput |
archive(ArchiveFormat format,
java.io.OutputStream stream)
Create a
Output.MultiOutput which writes an archive to the given stream. |
static Output.MultiOutput |
archive(ArchiveFormat format,
java.nio.file.Path path)
Create a
Output.MultiOutput which writes an archive to a file. |
abstract void |
close() |
static Output.MultiOutput |
detectedArchive(java.nio.file.Path path)
Create a
Output.MultiOutput which writes an archive to a file. |
static Output.MultiOutput |
folder(java.nio.file.Path output)
Create a
Output.MultiOutput which writes an archive to a folder. |
abstract void |
open(boolean clearOutput)
Called to open any internal resources and set up the output for writing.
|
abstract void |
write(java.lang.String path,
byte[] data)
Called to write a file to the output.
|
isSamePath, validatepublic static Output.MultiOutput archive(ArchiveFormat format, java.nio.file.Path path)
Output.MultiOutput which writes an archive to a file.format - The format of the archive.path - The destination.public static Output.MultiOutput detectedArchive(java.nio.file.Path path) throws java.lang.IllegalArgumentException
Output.MultiOutput which writes an archive to a file.
Will attempt to automatically detect the archive format based on file name.
If the format can not be detected it will throw a IllegalArgumentException
path - The path.java.lang.IllegalArgumentException - If the format cannot be detected.public static Output.MultiOutput archive(ArchiveFormat format, java.io.OutputStream stream)
Output.MultiOutput which writes an archive to the given stream.format - The format of the archive.stream - The destination.public static Output.MultiOutput folder(java.nio.file.Path output)
Output.MultiOutput which writes an archive to a folder.output - The destination folder.public abstract void open(boolean clearOutput)
throws java.io.IOException
clearOutput - If the output should be wiped, or written over top of.
This only effects Output.FolderMultiOutput. Archives
are always rewritten.java.io.IOExceptionpublic abstract void write(java.lang.String path,
byte[] data)
throws java.io.IOException
path - The relative path of the output. Will not contain a starting slash.data - The data.java.io.IOExceptionpublic abstract void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOException