Package eu.europa.esig.dss.enumerations
Interface MimeType
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
MimeTypeEnum
Identifies a file MimeType and its attributes
-
Method Summary
Modifier and TypeMethodDescriptionstatic MimeTypeThis method returns the mime-type extrapolated from the file.static MimeTypefromFileExtension(String fileExtension) ReturnsMimeTypematching to the providedfileExtensionStringstatic MimeTypefromFileName(String fileName) This method returns the mime-type extrapolated from the file name.static MimeTypefromMimeTypeString(String mimeTypeString) This method returns the first representation of theMimeTypecorresponding to the given mime-type string.Returns file extension corresponding to the MimeTypestatic StringgetFileExtension(String fileName) Returns the file extension based on the position of the '.' in the fileName.Gets String identifying the MimeTypestatic Iterable<MimeTypeLoader>
-
Method Details
-
getMimeTypeString
String getMimeTypeString()Gets String identifying the MimeType- Returns:
- the mimeTypeString
-
getExtension
String getExtension()Returns file extension corresponding to the MimeType- Returns:
Stringfile extension
-
fromMimeTypeString
This method returns the first representation of theMimeTypecorresponding to the given mime-type string.- Parameters:
mimeTypeString- is a string identifier composed of two parts: a "type" and a "subtype"- Returns:
- the extrapolated mime-type from the
String
-
fromFileExtension
ReturnsMimeTypematching to the providedfileExtensionString -
fromFileName
This method returns the mime-type extrapolated from the file name. -
fromFile
This method returns the mime-type extrapolated from the file.- Parameters:
file-Filethe file to be analysed- Returns:
- the extrapolated mime-type of the file if found,
MimeTypeEnum.BINARYotherwise
-
getFileExtension
Returns the file extension based on the position of the '.' in the fileName. File paths as "xxx.y/toto" are not handled.- Parameters:
fileName- to be analysed- Returns:
- the file extension or null
-
mimeTypeLoaders
-