org.jboss.shrinkwrap.api.exporter
Interface StreamExporter

All Superinterfaces:
Assignable
All Known Subinterfaces:
TarExporter, TarGzExporter, ZipExporter

public interface StreamExporter
extends Assignable

Generic exporter capable of representing an Assignable as an InputStream, or writing its contents to a provided OutputStream or File.

Version:
$Revision: $
Author:
ALR

Method Summary
 InputStream exportAsInputStream()
          Exports this reference in an implementation-specific format represented by the returned new InputStream instance
 void exportTo(File target)
          Exports provided archive as in an implementation-specific format, written to the specified File target.
 void exportTo(File target, boolean overwrite)
          Exports provided archive an implementation-specific format, written to the specified File target.
 void exportTo(OutputStream target)
          Exports provided archive in an implementation-specific format, written to the specified OutputStream target.
 
Methods inherited from interface org.jboss.shrinkwrap.api.Assignable
as
 

Method Detail

exportAsInputStream

InputStream exportAsInputStream()
Exports this reference in an implementation-specific format represented by the returned new InputStream instance

Returns:
A new InputStream to read the exported view

exportTo

void exportTo(OutputStream target)
              throws ArchiveExportException,
                     IllegalArgumentException
Exports provided archive in an implementation-specific format, written to the specified OutputStream target. The specified target will not be closed or flushed; this is the responsibility of the caller (who supplied the OutputStream in the first place).

Parameters:
target -
Throws:
ArchiveExportException
IllegalArgumentException - If the target is not specified or is closed

exportTo

void exportTo(File target)
              throws ArchiveExportException,
                     FileExistsException,
                     IllegalArgumentException
Exports provided archive as in an implementation-specific format, written to the specified File target. If the target exists this call will fail with IllegalArgumentException

Parameters:
target -
Throws:
IllegalArgumentException - If the target is not specified
FileExistsException - If the target already exists
ArchiveExportException - if the export process fails

exportTo

void exportTo(File target,
              boolean overwrite)
              throws ArchiveExportException,
                     FileExistsException,
                     IllegalArgumentException
Exports provided archive an implementation-specific format, written to the specified File target. 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 with IllegalArgumentException

Parameters:
target -
Throws:
IllegalArgumentException - If the target is not specified or is a directory
FileExistsException - If the target both already exists and the overwrite flag is false
ArchiveExportException - if the export process fails


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.