public abstract class StreamExporterDelegateBase<O extends OutputStream> extends AbstractExporterDelegate<InputStream>
OutputStream
Modifier and Type | Field and Description |
---|---|
protected CountDownLatch |
latch
Synchronization point where the encoding process will wait until all streams have been set up
|
protected O |
outputStream
OutputStream used to write the individual entries |
Constructor and Description |
---|
StreamExporterDelegateBase(Archive<?> archive)
Creates a new exporter delegate for exporting archives
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeEntry(O outputStream)
Closes the current entry context for the specified
OutputStream |
protected abstract O |
createOutputStream(OutputStream out)
Creates the real
OutputStream to which we'll write, wrapping the provided target. |
protected void |
doExport()
Primary method providing a template for exporting the contents of an archive
|
protected Set<ArchivePath> |
getExportedPaths()
Returns an immutable view of all
ArchivePath s currently exported |
protected abstract Callable<Void> |
getExportTask(Callable<Void> wrappedTask)
Returns the task used to run the export operation in another Thread.
|
protected InputStream |
getResult()
Return the results of the export.
|
protected void |
processNode(ArchivePath path,
Node node)
Template method for processing a single node.
|
protected abstract void |
putNextExtry(O outputStream,
String context)
Writes the next entry (demarcates a new file/folder is to be written)
|
export, getArchive
protected O extends OutputStream outputStream
OutputStream
used to write the individual entriesprotected final CountDownLatch latch
public StreamExporterDelegateBase(Archive<?> archive) throws IllegalArgumentException
IllegalArgumentException
protected abstract Callable<Void> getExportTask(Callable<Void> wrappedTask)
wrappedTask
- The export task to be wrapped in more specific handling logicprotected void doExport()
doExport
in class AbstractExporterDelegate<InputStream>
AbstractExporterDelegate.doExport()
protected abstract void putNextExtry(O outputStream, String context) throws IOException
outputStream
- context
- IOException
- If an error occurred writing the entryprotected abstract void closeEntry(O outputStream) throws IOException
OutputStream
outputStream
- IOException
protected abstract O createOutputStream(OutputStream out) throws IOException
OutputStream
to which we'll write, wrapping the provided target.out
- IOException
- If an error occurred in creating the streamprotected void processNode(ArchivePath path, Node node)
processNode
in class AbstractExporterDelegate<InputStream>
AbstractExporterDelegate.processNode(ArchivePath, Node)
protected InputStream getResult()
getResult
in class AbstractExporterDelegate<InputStream>
AbstractExporterDelegate.getResult()
protected final Set<ArchivePath> getExportedPaths()
ArchivePath
s currently exportedCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.