public class TLcdTarInputStreamFactory extends Object implements ILcdInputStreamFactory, ILcdInputStreamFactoryCapable
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>.
Constructor and Description |
---|
TLcdTarInputStreamFactory()
Creates a new
TLcdTarInputStreamFactory with a default
TLcdInputStreamFactory . |
TLcdTarInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Creates a new
TLcdTarInputStreamFactory with the given
ILcdInputStreamFactory . |
Modifier and Type | Method and Description |
---|---|
InputStream |
createInputStream(String aSourceName)
Creates an input stream from a source name that represents an entry in a
tar file.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Gets the input stream factory that is used for creating input streams from tar source names.
|
static String |
getSourceName(String aSourceName,
String aEntryName)
Builds a source name for an entry in a tar file.
|
static String |
getTarEntryName(String aSourceName)
Extracts the entry name from an entry source name.
|
static String |
getTarName(String aSourceName)
Extracts the tar file name from an entry source name.
|
void |
setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
Sets the input stream factory that is used for creating input streams from tar source names.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canCreateInputStream
public TLcdTarInputStreamFactory()
TLcdTarInputStreamFactory
with a default
TLcdInputStreamFactory
.public TLcdTarInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
TLcdTarInputStreamFactory
with the given
ILcdInputStreamFactory
.aInputStreamFactory
- the ILcdInputStreamFactory
to set.public void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the ILcdInputStreamFactory
to set.public ILcdInputStreamFactory getInputStreamFactory()
getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
ILcdInputStreamFactory
that will be used for creating input streams
from tar source names.public InputStream createInputStream(String aSourceName) throws IOException
createInputStream
in interface ILcdInputStreamFactory
aSourceName
- source name of an entry in a tar file.InputStream
that corresponds with the aSourceName
.IOException
ILcdInputStreamFactory.canCreateInputStream(String)
public static String getSourceName(String aSourceName, String aEntryName)
aSourceName
- source name of the tar file.aEntryName
- the name of the entry in the tar file.public static String getTarName(String aSourceName)
aSourceName
- an entry source name.