public class LZMAUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
LZMAUtils.CachedAvailability |
Modifier and Type | Field and Description |
---|---|
private static LZMAUtils.CachedAvailability |
cachedLZMAAvailability |
private static FileNameUtil |
fileNameUtil |
private static byte[] |
HEADER_MAGIC
LZMA Header Magic Bytes begin a LZMA file.
|
Modifier | Constructor and Description |
---|---|
private |
LZMAUtils()
Private constructor to prevent instantiation of this utility class.
|
Modifier and Type | Method and Description |
---|---|
(package private) static LZMAUtils.CachedAvailability |
getCachedLZMAAvailability() |
static java.lang.String |
getCompressedFilename(java.lang.String filename)
Maps the given filename to the name that the file should have after
compression with lzma.
|
static java.lang.String |
getUncompressedFilename(java.lang.String filename)
Maps the given name of a lzma-compressed file to the name that
the file should have after uncompression.
|
private static boolean |
internalIsLZMACompressionAvailable() |
static boolean |
isCompressedFilename(java.lang.String filename)
Detects common lzma suffixes in the given filename.
|
static boolean |
isLZMACompressionAvailable()
Are the classes required to support LZMA compression available?
|
static boolean |
matches(byte[] signature,
int length)
Checks if the signature matches what is expected for a .lzma file.
|
static void |
setCacheLZMAAvailablity(boolean doCache)
Whether to cache the result of the LZMA check.
|
private static final FileNameUtil fileNameUtil
private static final byte[] HEADER_MAGIC
private static volatile LZMAUtils.CachedAvailability cachedLZMAAvailability
private LZMAUtils()
public static boolean matches(byte[] signature, int length)
signature
- the bytes to checklength
- the number of bytes to checkpublic static boolean isLZMACompressionAvailable()
private static boolean internalIsLZMACompressionAvailable()
public static boolean isCompressedFilename(java.lang.String filename)
filename
- name of a filetrue
if the filename has a common lzma suffix,
false
otherwisepublic static java.lang.String getUncompressedFilename(java.lang.String filename)
filename
- name of a filepublic static java.lang.String getCompressedFilename(java.lang.String filename)
filename
- name of a filepublic static void setCacheLZMAAvailablity(boolean doCache)
This defaults to false
in an OSGi environment and true
otherwise.
doCache
- whether to cache the resultstatic LZMAUtils.CachedAvailability getCachedLZMAAvailability()