public class MimeType extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static MimeType |
ASICE |
static MimeType |
ASICS |
static MimeType |
BINARY |
static MimeType |
JPEG |
static MimeType |
ODS |
static MimeType |
ODT |
static MimeType |
PDF |
static MimeType |
PKCS7 |
static MimeType |
PNG |
static MimeType |
TEXT |
static MimeType |
TST |
static MimeType |
XML |
| Constructor and Description |
|---|
MimeType()
This constructor is used only by the web-services.
|
MimeType(String mimeTypeString,
String extension)
This constructor allows to create a new MimeType related to given file
extension.
|
| Modifier and Type | Method and Description |
|---|---|
void |
defineFileExtension(String extension)
This method allows to define a new relationship between a file extension
and a
MimeType. |
boolean |
equals(Object obj) |
static MimeType |
fromFile(File file)
This method returns the mime-type extrapolated from the file.
|
static MimeType |
fromFileName(String fileName)
This method returns the mime-type extrapolated from the file name.
|
static MimeType |
fromMimeTypeString(String mimeTypeString)
This method returns the first representation of the
MimeType
corresponding to the given mime-type string. |
static String |
getExtension(MimeType mimeType) |
static String |
getFileExtension(String path)
Returns the file extension based on the position of the '.' in the path.
|
String |
getMimeTypeString() |
int |
hashCode() |
void |
setMimeTypeString(String mimeTypeString)
This setter is used by the web-services.
|
public static final MimeType BINARY
public static final MimeType XML
public static final MimeType PDF
public static final MimeType PKCS7
public static final MimeType TST
public static final MimeType ASICS
public static final MimeType ASICE
public static final MimeType ODT
public static final MimeType ODS
public static final MimeType TEXT
public static final MimeType PNG
public static final MimeType JPEG
public MimeType()
public MimeType(String mimeTypeString, String extension)
MimeType then this relation will be lost.mimeTypeString - is a string identifier composed of two parts: a "type" and a
"subtype"extension - to be defined. Example: "txt", note that there is no point
before the extension name.public String getMimeTypeString()
public void setMimeTypeString(String mimeTypeString)
mimeTypeString - is a string identifier composed of two parts: a "type" and a
"subtype"public static MimeType fromFileName(String fileName)
fileName - the file name to be analysedpublic static String getFileExtension(String path)
path - to be analysedpublic static MimeType fromFile(File file)
file - the file to be analysedpublic static MimeType fromMimeTypeString(String mimeTypeString)
MimeType
corresponding to the given mime-type string.mimeTypeString - is a string identifier composed of two parts: a "type" and a
"subtype"Stringpublic void defineFileExtension(String extension)
MimeType.extension - to be defined. Example: "txt", note that there is no point
before the extension name.Copyright © 2018. All rights reserved.