Package org.apache.jackrabbit.vault.util
Class MimeTypes
java.lang.Object
org.apache.jackrabbit.vault.util.MimeTypes
MimeTypes contains a mapping from extensions to mime types.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetExtension(String mimeType) Retrieve the default extension for the given mime typestatic StringgetMimeType(String name) Retrieve the mimetype for the given extension or namestatic StringgetMimeType(String name, String defaultType) Retrieve the mimetype for the given extension or namestatic booleanhasExtension(String mimeType, String ext) Checks if the given mime type is mapped to the extensionstatic booleanchecks if the given mimetype denotes binary contentstatic boolean
-
Field Details
-
APPLICATION_OCTET_STREAM
constant for "application/octet-stream"- See Also:
-
-
Constructor Details
-
MimeTypes
public MimeTypes()
-
-
Method Details
-
getMimeType
Retrieve the mimetype for the given extension or name- Parameters:
name- the name- Returns:
- the mimetype or
null
-
getMimeType
Retrieve the mimetype for the given extension or name- Parameters:
name- the namedefaultType- type to return if no mapping is found.- Returns:
- the mimetype or
null
-
getExtension
Retrieve the default extension for the given mime type- Parameters:
mimeType- the mime type- Returns:
- the extension or null
-
isBinary
checks if the given mimetype denotes binary content- Parameters:
mimeType- the mime type- Returns:
trueif binary or ifmimeTypeisnull
-
hasExtension
Checks if the given mime type is mapped to the extension- Parameters:
mimeType- the mime typeext- the extension- Returns:
trueif the given mime type contains that extension
-
matches
-