public class DataFormat extends UntypedData
For MIME type definition, we make use of the Tika library package.
| Modifier and Type | Field and Description |
|---|---|
static DataFormat |
UNKNOWN_FORMAT
The unknown format
|
EMPTY, string| Constructor and Description |
|---|
DataFormat()
construct a DataFormat object with unknown type
|
DataFormat(String mimeType)
Constructor for DataFormat.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(UntypedData datatype) |
String |
getMimeType()
Getter for the field
mimeType. |
static DataFormat |
guessDataFormat(InputStream input)
Guess the DataFormat for a given file
|
void |
setMimeType(String mimeType)
Setter for the field
mimeType. |
String |
toString() |
public static final DataFormat UNKNOWN_FORMAT
public DataFormat()
public DataFormat(String mimeType) throws DataFormatException
mimeType - the data format as MIME type in the format
major / minor
E.g. unknown is:
application / octet - stream
DataFormatException - if using a non valid MIME type.public int compareTo(UntypedData datatype)
compareTo in interface Comparable<UntypedData>compareTo in class UntypedDatapublic static DataFormat guessDataFormat(InputStream input)
input - a InputStream object.UNKNOWN_FORMATpublic String getMimeType()
mimeType.public void setMimeType(String mimeType)
mimeType.mimeType - the mimeType to setpublic String toString()
toString in class UntypedDataCopyright © 2015 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK). All rights reserved.