Interface MimeType
- All Superinterfaces:
Serializable
This class represents a simple immutable MIME type object. A mime type is made up of
two parts
Both the base type and sub type can also be the wild card
<base type>/<sub type>
.
The base type can be something like application
or text
and
the the sub type can be something like xml
or plain
.
Both the base type and sub type can also be the wild card
*
such as
*/*
and text/*
. Note, if the base type is the wild card
then the sub type must also be a wild card.- Since:
- 5.0.100
-
Method Summary
Modifier and TypeMethodDescriptionReturns the base type.@Nullable String
Get the associated filename extension.@NotNull Collection<String>
Get the possible associated filename extensions.Returns the sub type, means the concrete format.toString()
Returns a string representation of this object.
-
Method Details
-
getExtension
Get the associated filename extension. e.g. in case of myPdfFile.pdf the mime-type is 'application/pdf' and 'pdf' the filename extension.- Returns:
- the filename extension string
- Since:
- 5.0.100
-
getExtensions
Get the possible associated filename extensions. e.g. in case of myJpgFile.jpg the mime-type is 'application/jp(e)g' and 'jpeg' or 'jpg' the filename extension.- Returns:
- the filename extension string
- Since:
- 5.0.209
-
getBaseType
String getBaseType()Returns the base type. In case of 'application/pdf' it returns 'application'.- Returns:
- the base type
- Since:
- 5.0.100
-
getSubType
String getSubType()Returns the sub type, means the concrete format. In case of 'application/pdf' it returns 'pdf'.- Returns:
- the sub type
- Since:
- 5.0.100
-
toString
String toString()Returns a string representation of this object. e.g. 'application/pdf'
-