public final class FileType
extends java.lang.Object
ArchiveFormat
and/or CompressionType
.Modifier and Type | Field and Description |
---|---|
static FileType |
UNKNOWN
Special case object for an unknown archive/compression file type.
|
Modifier and Type | Method and Description |
---|---|
static FileType |
get(java.io.File file)
Checks the suffix of the given
File for an entry in the map. |
static FileType |
get(java.lang.String filename)
Checks the suffix of the given string for an entry in the map.
|
ArchiveFormat |
getArchiveFormat()
Returns the archive format corresponding to this file extension if any.
|
CompressionType |
getCompressionType()
Returns the compression type corresponding to this file extension if any.
|
java.lang.String |
getSuffix()
Returns the file extension suffix (e.g.
|
boolean |
isArchive()
Returns true if the given file extension denotes an archive.
|
boolean |
isCompressed()
Returns true if the given file extension denotes a compressed file.
|
java.lang.String |
toString() |
public static final FileType UNKNOWN
public boolean isArchive()
public boolean isCompressed()
public java.lang.String getSuffix()
public ArchiveFormat getArchiveFormat()
public CompressionType getCompressionType()
public java.lang.String toString()
toString
in class java.lang.Object
public static FileType get(java.lang.String filename)
FileType
entry will be returned.filename
- the filename to checkFileType
entry for the file extension of the given name, or the UNKNOWN type if it does not
existpublic static FileType get(java.io.File file)
File
for an entry in the map. If it exists, the corresponding
FileType
entry will be returned.file
- the file to checkFileType
entry for the file extension of the given file, or the UNKNOWN type if it does not
exist