Class AbstractStreamExporterImpl
java.lang.Object
org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
org.jboss.shrinkwrap.impl.base.exporter.AbstractStreamExporterImpl
- All Implemented Interfaces:
Assignable,StreamExporter
- Direct Known Subclasses:
TarBz2ExporterImpl,TarExporterImpl,TarGzExporterImpl,ZipExporterImpl
public abstract class AbstractStreamExporterImpl
extends AssignableBase<Archive<?>>
implements StreamExporter
Base support for I/O Stream-based exporters
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidExports provided archive as in an implementation-specific format, written to the specifiedFiletarget.final voidExports provided archive an implementation-specific format, written to the specifiedFiletarget.voidexportTo(OutputStream target) Exports provided archive in an implementation-specific format, written to the specifiedOutputStreamtarget.protected final OutputStreamgetOutputStreamToFile(File target, boolean overwrite) Obtains anOutputStreamto the providedFile.Methods inherited from class org.jboss.shrinkwrap.impl.base.AssignableBase
as, getArchiveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.shrinkwrap.api.Assignable
asMethods inherited from interface org.jboss.shrinkwrap.api.exporter.StreamExporter
exportAsInputStream
-
Field Details
-
log
Logger
-
-
Constructor Details
-
AbstractStreamExporterImpl
-
-
Method Details
-
getOutputStreamToFile
protected final OutputStream getOutputStreamToFile(File target, boolean overwrite) throws FileExistsException Obtains anOutputStreamto the providedFile.- Parameters:
target-overwrite- Whether we may overwrite an existing file- Returns:
- Throws:
FileExistsException- If the specified file exists and the overwrite flag is falseIllegalArgumentException- If the file target is not specified
-
exportTo
Exports provided archive in an implementation-specific format, written to the specifiedOutputStreamtarget. The specified target will not be closed or flushed; this is the responsibility of the caller (who supplied theOutputStreamin the first place).- Specified by:
exportToin interfaceStreamExporter- Parameters:
target-- Throws:
ArchiveExportExceptionIllegalArgumentException- If the target is not specified or is closed- See Also:
-
exportTo
public final void exportTo(File target, boolean overwrite) throws ArchiveExportException, FileExistsException Exports provided archive an implementation-specific format, written to the specifiedFiletarget. If the target both exists and the "overwrite" flag is true, this call will allow the existing file to be overwritten, else the invocation will fail withIllegalArgumentException- Specified by:
exportToin interfaceStreamExporter- Parameters:
target-- Throws:
ArchiveExportException- if the export process failsFileExistsException- If the target both already exists and the overwrite flag is false- See Also:
-
exportTo
Exports provided archive as in an implementation-specific format, written to the specifiedFiletarget. If the target exists this call will fail withIllegalArgumentException- Specified by:
exportToin interfaceStreamExporter- Parameters:
target-- Throws:
ArchiveExportException- if the export process failsFileExistsException- If the target already exists- See Also:
-