Package org.apache.druid.utils
Enum Class CompressionUtils.Format
- All Implemented Interfaces:
Serializable,Comparable<CompressionUtils.Format>,Constable
- Enclosing class:
- CompressionUtils
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionlongcompressDirectory(File directory, OutputStream out) Compresses a directory to the output stream.decompressDirectory(InputStream in, File outDir) Decompresses a directory from the input stream.static CompressionUtils.FormatfromFileName(String fileName) static CompressionUtils.FormatfromString(String name) static CompressionUtils.FormatReturns the enum constant of this class with the specified name.static CompressionUtils.Format[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BZ2
-
GZ
-
LZ4
-
SNAPPY
-
XZ
-
ZIP
-
ZSTD
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getSuffix
-
getExtension
-
fromString
-
fromFileName
-
compressDirectory
Compresses a directory to the output stream. Default implementation throws UnsupportedOperationException. Override this method for formats that support directory compression.- Parameters:
directory- The directory to compressout- The output stream to write compressed data to- Returns:
- The number of bytes (uncompressed) read from the input directory
- Throws:
IOException- if an I/O error occursUnsupportedOperationException- if the format doesn't support directory compression
-
decompressDirectory
Decompresses a directory from the input stream. Default implementation throws UnsupportedOperationException. Override this method for formats that support directory decompression.- Parameters:
in- The input stream containing compressed dataoutDir- The output directory to extract files to- Returns:
- A FileCopyResult containing information about extracted files
- Throws:
IOException- if an I/O error occursUnsupportedOperationException- if the format doesn't support directory decompression
-