Package com.luciad.io
Class TLcdZipInputStreamFactory
java.lang.Object
com.luciad.io.TLcdZipInputStreamFactory
- All Implemented Interfaces:
ILcdInputStreamFactory
,ILcdInputStreamFactoryCapable
public class TLcdZipInputStreamFactory
extends Object
implements ILcdInputStreamFactory, ILcdInputStreamFactoryCapable
This class implements a
ILcdInputStreamFactory
that can create
input streams from source names that represent zip files or entries in zip
files. The zip files themselves are accessed by means of a given
ILcdInputStreamFactory
.
Source names for entries in zip files must be formatted as <zip_source_name>!<entry name>.
- Since:
- 7.0.17
-
Constructor Summary
ConstructorDescriptionCreates a newTLcdZipInputStreamFactory
with a defaultTLcdInputStreamFactory
.TLcdZipInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Creates a newTLcdZipInputStreamFactory
with the givenILcdInputStreamFactory
. -
Method Summary
Modifier and TypeMethodDescriptioncreateInputStream
(String aSourceName) Creates an input stream from a source name that represents an entry in a zip file.Gets the input stream factory that is used for creating input streams from zip source names.static String
getSourceName
(String aSourceName, String aEntryName) Builds a source name for an entry in a zip file.static String
getZipEntryName
(String aSourceName) Extracts the entry name from an entry source name.static String
getZipName
(String aSourceName) Extracts the zip file name from an entry source name.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets the input stream factory that is used for creating input streams from zip source names.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.io.ILcdInputStreamFactory
canCreateInputStream
-
Constructor Details
-
TLcdZipInputStreamFactory
public TLcdZipInputStreamFactory()Creates a newTLcdZipInputStreamFactory
with a defaultTLcdInputStreamFactory
. -
TLcdZipInputStreamFactory
Creates a newTLcdZipInputStreamFactory
with the givenILcdInputStreamFactory
.- Parameters:
aInputStreamFactory
- theILcdInputStreamFactory
to set.
-
-
Method Details
-
setInputStreamFactory
Sets the input stream factory that is used for creating input streams from zip source names.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- theILcdInputStreamFactory
to set.
-
getInputStreamFactory
Gets the input stream factory that is used for creating input streams from zip source names.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- the
ILcdInputStreamFactory
that will be used for creating input streams from zip source names.
-
createInputStream
Creates an input stream from a source name that represents an entry in a zip file. Source names for entries in a zip file should be formatted as [zip source name]![entry name]. Otherwise, the input stream is created directly, without interpreting the file as a zip file.- Specified by:
createInputStream
in interfaceILcdInputStreamFactory
- Parameters:
aSourceName
- source name of a zip file or an entry in a zip file.- Returns:
- the
InputStream
that corresponds with theaSourceName
. - Throws:
IOException
- See Also:
-
getSourceName
Builds a source name for an entry in a zip file.- Parameters:
aSourceName
- source name of the zip file.aEntryName
- the name of the entry in the zip file.- Returns:
- the source name of the entry in the zip file.
-
getZipName
Extracts the zip file name from an entry source name.- Parameters:
aSourceName
- an entry source name.- Returns:
- the zip file name
-
getZipEntryName
Extracts the entry name from an entry source name.- Parameters:
aSourceName
- an entry source name.- Returns:
- the zip file name
-