ShrinkWrap Implementation Base 1.0.0-cr-2

org.jboss.shrinkwrap.impl.base.exporter
Class AbstractStreamExporterImpl

java.lang.Object
  extended by org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
      extended by org.jboss.shrinkwrap.impl.base.exporter.AbstractStreamExporterImpl
All Implemented Interfaces:
Assignable, StreamExporter
Direct Known Subclasses:
TarExporterImpl, TarGzExporterImpl, ZipExporterImpl

public abstract class AbstractStreamExporterImpl
extends AssignableBase<Archive<?>>
implements StreamExporter

Base support for I/O Stream-based exporters

Author:
ALR

Constructor Summary
AbstractStreamExporterImpl(Archive<?> archive)
           
 
Method Summary
 void exportTo(File target)
          
 void exportTo(File target, boolean overwrite)
          
 void exportTo(OutputStream target)
          
protected  OutputStream getOutputStreamToFile(File target, boolean overwrite)
          Obtains an OuputStream to the provided File.
 
Methods inherited from class org.jboss.shrinkwrap.impl.base.AssignableBase
as, getArchive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.shrinkwrap.api.exporter.StreamExporter
exportAsInputStream
 
Methods inherited from interface org.jboss.shrinkwrap.api.Assignable
as
 

Constructor Detail

AbstractStreamExporterImpl

public AbstractStreamExporterImpl(Archive<?> archive)
Method Detail

getOutputStreamToFile

protected final OutputStream getOutputStreamToFile(File target,
                                                   boolean overwrite)
                                            throws FileExistsException
Obtains an OuputStream to the provided File.

Parameters:
target -
overwrite - Whether we may overwrite an existing file
Returns:
Throws:
FileExistsException - If the specified file exists and the overwrite flag is false
IllegalArgumentException - If the file target is not specified

exportTo

public void exportTo(OutputStream target)
              throws ArchiveExportException,
                     IllegalArgumentException

Specified by:
exportTo in interface StreamExporter
Throws:
ArchiveExportException
IllegalArgumentException
See Also:
StreamExporter.exportTo(java.io.OutputStream)

exportTo

public final void exportTo(File target,
                           boolean overwrite)
                    throws ArchiveExportException,
                           FileExistsException

Specified by:
exportTo in interface StreamExporter
Throws:
ArchiveExportException
FileExistsException
See Also:
StreamExporter.exportTo(java.io.File, boolean)

exportTo

public final void exportTo(File target)
                    throws ArchiveExportException,
                           FileExistsException

Specified by:
exportTo in interface StreamExporter
Throws:
ArchiveExportException
FileExistsException
See Also:
StreamExporter.exportTo(java.io.File)

ShrinkWrap Implementation Base 1.0.0-cr-2

Copyright © 2011 JBoss by Red Hat. All Rights Reserved.