org.jboss.shrinkwrap.api.importer
Interface StreamImporter<I extends StreamImporter<I>>

Type Parameters:
I - Concrete type used in covariant return
All Superinterfaces:
Assignable
All Known Subinterfaces:
TarGzImporter, TarImporter, ZipImporter

public interface StreamImporter<I extends StreamImporter<I>>
extends Assignable

Generic importer capable of representing an Assignable as an entity capable of reading from an InputStream, or file type.

Author:
ALR

Method Summary
 I importFrom(File file)
          Imports provided File as a Archive.
 I importFrom(InputStream stream)
          Imports provided stream as a Archive.
 
Methods inherited from interface org.jboss.shrinkwrap.api.Assignable
as
 

Method Detail

importFrom

I importFrom(InputStream stream)
                                       throws ArchiveImportException
Imports provided stream as a Archive. It remains the responsibility of the caller to close the stream.

Parameters:
stream - the stream to import; should be a raw type, not wrapped in any implementation-specific encoding (ie. FileInputStream is appropriate, but ZipInputStream or GZIPInputStream is not).
Returns:
Archive of the imported stream
Throws:
ArchiveImportException - If an error occurred during the import process
IllegalArgumentException - If no stream is specified

importFrom

I importFrom(File file)
                                       throws ArchiveImportException
Imports provided File as a Archive.

Parameters:
file - the file to import
Returns:
Archive of the imported Zip
Throws:
ArchiveImportException - If an error occurred during the import process
IllegalArgumentException - If no file is specified or if the file is a directory


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