Class CompressedFile
java.lang.Object
com.vividsolutions.jump.io.CompressedFile
Utility class for dealing with compressed files.
- Author:
- dblasby, ede
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateLayerName(URI uri) static String[]static StringgetExtension(String path) returns second level extension for compressed files eg.static String[]static StringgetInternalZipFnameByExtension(String extension, String compressedFile) Deprecated.only used by very old data readers which only deliver the first file in zip file [ede 05.2012]static StringgetTargetFileWithPath(URI uri) static booleanhasArchiveFileExtension(String filename) static booleanhasCompressedFileExtension(String filename) static booleanstatic booleanstatic booleanstatic booleanisCompressed(String filePath) static booleanisCompressed(URI uri) static booleanstatic booleanstatic booleanstatic booleanstatic booleanlistEntries(File file) static InputStreamstatic InputStreamUtility file open function - handles compressed and un-compressed files.static InputStreamstatic URIreplaceTargetFileName(URI uri, String filename) static URIreplaceTargetFileWithPath(URI uri, String location)
-
Constructor Details
-
CompressedFile
public CompressedFile()Creates a new CompressedFile
-
-
Method Details
-
getInternalZipFnameByExtension
public static String getInternalZipFnameByExtension(String extension, String compressedFile) throws Exception Deprecated.only used by very old data readers which only deliver the first file in zip file [ede 05.2012]Searches through the .zip file looking for a file with the given extension. Returns null if it doesn't find one.- Throws:
Exception
-
listEntries
-
openFile
- Throws:
URISyntaxExceptionIOException
-
openFile
- Throws:
IOException
-
openFile
Utility file open function - handles compressed and un-compressed files.- Parameters:
filePath- name of the file to search for.compressedEntry- name of the compressed file.If compressedEntry = null, opens a FileInputStream on filePath
If filePath ends in ".zip" - opens the compressed Zip and looks for the file called compressedEntry
If filePath ends in ".gz" - opens the compressed .gz file.
- Throws:
IOException
-
isCompressed
-
isArchive
-
isCompressed
-
isArchive
-
isZip
-
isTar
-
isGZip
-
isBZip
-
isXZ
-
isSevenZ
-
getArchiveExtensions
-
getFileExtensions
-
getExtension
-
hasCompressedFileExtension
-
hasArchiveFileExtension
-
getTargetFileWithPath
-
replaceTargetFileWithPath
-
replaceTargetFileName
-
createLayerName
-