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 MimeType
This method returns the mime-type extrapolated from the file.static MimeType
fromFileExtension
(String fileExtension) ReturnsMimeType
matching to the providedfileExtension
Stringstatic 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 theMimeType
corresponding to the given mime-type string.Returns file extension corresponding to the MimeTypestatic String
getFileExtension
(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:
String
file extension
-
fromMimeTypeString
This method returns the first representation of theMimeType
corresponding 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
ReturnsMimeType
matching to the providedfileExtension
String -
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
-File
the file to be analysed- Returns:
- the extrapolated mime-type of the file if found,
MimeTypeEnum.BINARY
otherwise
-
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
-