Package com.illumon.iris.db.tables.utils
Class CompressedFileUtils
java.lang.Object
com.illumon.iris.db.tables.utils.CompressedFileUtils
Util File that handles .zst file compressions in addition to compression formats supported by
CompressedFileUtil-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisZeeStandardCompressedFile(String sFileName) Method reads the first 4 bytes of the passed in file and returns true if they match Zstandard compression formats magic numberstatic InputStreamopenPossiblyCompressedFile(String sFileName) Takes in the full path of a file and returns an instance ofInputStreamafter checking and decompressing the file if it is one of ".gz", ".tgz", ".tar.gz", ".zip", ".bz2", ".7z", ".zst" compression formats, otherwise returns an instance ofInputStreamas is.static InputStreamopenZeeStandardCompressedFile(String sFileName) The given Zstandard compressed file, is opened usingZstdCompressorInputStreamand returned as anInputStream
-
Constructor Details
-
CompressedFileUtils
public CompressedFileUtils()
-
-
Method Details
-
openPossiblyCompressedFile
Takes in the full path of a file and returns an instance ofInputStreamafter checking and decompressing the file if it is one of ".gz", ".tgz", ".tar.gz", ".zip", ".bz2", ".7z", ".zst" compression formats, otherwise returns an instance ofInputStreamas is.- Parameters:
sFileName- full path including the filename of the possible compression file- Returns:
- The InputStream of the given file after decompressing if necessary.
- Throws:
IOException- if an IOException occurs when handling the given file
-
isZeeStandardCompressedFile
Method reads the first 4 bytes of the passed in file and returns true if they match Zstandard compression formats magic number- Parameters:
sFileName- full path including the filename of the possible compression file- Returns:
- true if given path represents a file compressed using the Zstandard compression format
- Throws:
IOException- if an IOException occurs when verifying the given file
-
openZeeStandardCompressedFile
The given Zstandard compressed file, is opened usingZstdCompressorInputStreamand returned as anInputStream- Parameters:
sFileName- full path including the filename of the Zstandard compressed file- Returns:
- InputStream after decompressing using
ZstdCompressorInputStreamon the given file - Throws:
IOException- if an IOException occurs when opening the given file
-