Class TarImporterBase<S extends TarInputStream,I extends StreamImporter<I>>
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
-
- org.jboss.shrinkwrap.impl.base.importer.tar.TarImporterBase<S,I>
-
- All Implemented Interfaces:
Assignable
,StreamImporter<I>
- Direct Known Subclasses:
TarBz2ImporterImpl
,TarGzImporterImpl
,TarImporterImpl
abstract class TarImporterBase<S extends TarInputStream,I extends StreamImporter<I>> extends AssignableBase<Archive<?>> implements StreamImporter<I>
Base of implementations used to import existing TAR files/streams into the givenArchive
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
log
Logger
-
Constructor Summary
Constructors Constructor Description TarImporterBase(Archive<?> archive)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private I
covarientReturn()
Provides covarient return(package private) abstract java.lang.Class<I>
getActualClass()
Returns the actual class for this implementationprivate S
getInputStreamForFile(java.io.File file)
Obtains an implementation-specific stream to the specifiedFile
(package private) abstract S
getInputStreamForRawStream(java.io.InputStream in)
Obtains the correctInputStream
wrapper type for the specified raw data inputI
importFrom(java.io.File file)
Imports provided File as aArchive
.I
importFrom(java.io.File file, Filter<ArchivePath> filter)
Imports provided File as aArchive
.I
importFrom(java.io.InputStream stream)
Imports provided stream as aArchive
.I
importFrom(java.io.InputStream stream, Filter<ArchivePath> filter)
Imports provided stream as aArchive
.private I
importFrom(S stream, Filter<ArchivePath> filter)
-
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.Assignable
as
-
-
-
-
Constructor Detail
-
TarImporterBase
public TarImporterBase(Archive<?> archive)
-
-
Method Detail
-
getActualClass
abstract java.lang.Class<I> getActualClass()
Returns the actual class for this implementation
-
getInputStreamForRawStream
abstract S getInputStreamForRawStream(java.io.InputStream in) throws java.io.IOException
Obtains the correctInputStream
wrapper type for the specified raw data input- Parameters:
in
-- Returns:
- Throws:
java.io.IOException
-
covarientReturn
private I covarientReturn()
Provides covarient return
-
importFrom
public I importFrom(java.io.InputStream stream) throws ArchiveImportException
Imports provided stream as aArchive
. It remains the responsibility of the caller to close the stream.- Specified by:
importFrom
in interfaceStreamImporter<S extends TarInputStream>
- Parameters:
stream
- the stream to import; should be a raw type, not wrapped in any implementation-specific encoding (ie.FileInputStream
is appropriate, butZipInputStream
orGZIPInputStream
is not).- Returns:
- Archive of the imported stream
- Throws:
ArchiveImportException
- If an error occurred during the import process- See Also:
StreamImporter.importFrom(java.io.InputStream)
-
importFrom
public I importFrom(java.io.InputStream stream, Filter<ArchivePath> filter) throws ArchiveImportException
Imports provided stream as aArchive
. It remains the responsibility of the caller to close the stream.- Specified by:
importFrom
in interfaceStreamImporter<S extends TarInputStream>
- Parameters:
stream
- the stream to import; should be a raw type, not wrapped in any implementation-specific encoding (ie.FileInputStream
is appropriate, butZipInputStream
orGZIPInputStream
is not).filter
- Filter to match result- Returns:
- Archive of the imported stream
- Throws:
ArchiveImportException
- If an error occurred during the import process- See Also:
StreamImporter.importFrom(java.io.InputStream, Filter)
-
importFrom
private I importFrom(S stream, Filter<ArchivePath> filter) throws ArchiveImportException
- Throws:
ArchiveImportException
-
importFrom
public I importFrom(java.io.File file) throws ArchiveImportException
Imports provided File as aArchive
.- Specified by:
importFrom
in interfaceStreamImporter<S extends TarInputStream>
- Parameters:
file
- the file to import- Returns:
- Archive of the imported file
- Throws:
ArchiveImportException
- If an error occurred during the import process- See Also:
StreamImporter.importFrom(java.io.File)
-
importFrom
public I importFrom(java.io.File file, Filter<ArchivePath> filter) throws ArchiveImportException
Imports provided File as aArchive
.- Specified by:
importFrom
in interfaceStreamImporter<S extends TarInputStream>
- Parameters:
file
- the file to importfilter
- Filter to match result- Returns:
- Archive of the imported file
- Throws:
ArchiveImportException
- If an error occurred during the import process- See Also:
StreamImporter.importFrom(java.io.File, Filter)
-
getInputStreamForFile
private S getInputStreamForFile(java.io.File file) throws java.io.IOException
Obtains an implementation-specific stream to the specifiedFile
- Parameters:
file
- To open a stream to, must be specified- Returns:
- Throws:
java.io.IOException
- If there was a problem getting an instream to the file
-
-