public class TLcdTarInputStreamFactory extends java.lang.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 |
---|---|
java.io.InputStream |
createInputStream(java.lang.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 java.lang.String |
getSourceName(java.lang.String aSourceName,
java.lang.String aEntryName)
Builds a source name for an entry in a tar file.
|
static java.lang.String |
getTarEntryName(java.lang.String aSourceName)
Extracts the entry name from an entry source name.
|
static java.lang.String |
getTarName(java.lang.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.
|
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 java.io.InputStream createInputStream(java.lang.String aSourceName) throws java.io.IOException
createInputStream
in interface ILcdInputStreamFactory
aSourceName
- source name of an entry in a tar file.InputStream
that corresponds with the aSourceName
.java.io.IOException
public static java.lang.String getSourceName(java.lang.String aSourceName, java.lang.String aEntryName)
aSourceName
- source name of the tar file.aEntryName
- the name of the entry in the tar file.public static java.lang.String getTarName(java.lang.String aSourceName)
aSourceName
- an entry source name.public static java.lang.String getTarEntryName(java.lang.String aSourceName)
aSourceName
- an entry source name.