Package com.luciad.io
Class TLcdTarInputStreamFactory
java.lang.Object
com.luciad.io.TLcdTarInputStreamFactory
- All Implemented Interfaces:
ILcdInputStreamFactory,ILcdInputStreamFactoryCapable
public class TLcdTarInputStreamFactory
extends Object
implements ILcdInputStreamFactory, ILcdInputStreamFactoryCapable
This
ILcdInputStreamFactory creates input streams from source
names that represent tar files or entries in tar files. The tar files
themselves are accessed by means of a given ILcdInputStreamFactory.
Source names for entries in tar files must be formatted as <tar_source_name>!<entry name>.
- Since:
- 7.0.17
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTLcdTarInputStreamFactorywith a defaultTLcdInputStreamFactory.TLcdTarInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Creates a newTLcdTarInputStreamFactorywith the givenILcdInputStreamFactory. -
Method Summary
Modifier and TypeMethodDescriptioncreateInputStream(String aSourceName) Creates an input stream from a source name that represents an entry in a tar file.Gets the input stream factory that is used for creating input streams from tar source names.static StringgetSourceName(String aSourceName, String aEntryName) Builds a source name for an entry in a tar file.static StringgetTarEntryName(String aSourceName) Extracts the entry name from an entry source name.static StringgetTarName(String aSourceName) Extracts the tar file name from an entry source name.voidsetInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that is used for creating input streams from tar source names.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.io.ILcdInputStreamFactory
canCreateInputStream
-
Constructor Details
-
TLcdTarInputStreamFactory
public TLcdTarInputStreamFactory()Creates a newTLcdTarInputStreamFactorywith a defaultTLcdInputStreamFactory. -
TLcdTarInputStreamFactory
Creates a newTLcdTarInputStreamFactorywith the givenILcdInputStreamFactory.- Parameters:
aInputStreamFactory- theILcdInputStreamFactoryto set.
-
-
Method Details
-
setInputStreamFactory
Sets the input stream factory that is used for creating input streams from tar source names.- Specified by:
setInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Parameters:
aInputStreamFactory- theILcdInputStreamFactoryto set.
-
getInputStreamFactory
Gets the input stream factory that is used for creating input streams from tar source names.- Specified by:
getInputStreamFactoryin interfaceILcdInputStreamFactoryCapable- Returns:
- the
ILcdInputStreamFactorythat will be used for creating input streams from tar source names.
-
createInputStream
Creates an input stream from a source name that represents an entry in a tar file. Source names for entries in a tar file should be formatted as [tar source name]![entry name]. Otherwise, the input stream is created directly, without interpreting the file as a tar file.- Specified by:
createInputStreamin interfaceILcdInputStreamFactory- Parameters:
aSourceName- source name of an entry in a tar file.- Returns:
- the
InputStreamthat corresponds with theaSourceName. - Throws:
IOException- See Also:
-
getSourceName
Builds a source name for an entry in a tar file.- Parameters:
aSourceName- source name of the tar file.aEntryName- the name of the entry in the tar file.- Returns:
- the source name of the entry in the tar file.
-
getTarName
Extracts the tar file name from an entry source name.- Parameters:
aSourceName- an entry source name.- Returns:
- the tar file name
-
getTarEntryName
Extracts the entry name from an entry source name.- Parameters:
aSourceName- an entry source name.- Returns:
- the tar file name
-