A utility to help with mime type detection for a given file path or url.
Attributes
Members list
Value members
Concrete methods
Detects the MIME type of a given Byte array.
Detects the MIME type of a given Byte array.
When appropriate MIME Type can not be inferred, "text/pain" is returned.
Value parameters
- content
-
The Byte array for which to detect the MIME type
- fallback
-
A fallback value in case no MIME type can be found
Attributes
Detects the MIME type of a given File.
Detects the MIME type of a given File.
When appropriate MIME Type can not be inferred, "application/octet-stream" is returned.
This method guesses the MIME type using java.net.URLConnection.guessContentTypeFromName
. Therefore, by defining an arbitrary MIME type in the configuration file specified by the content.types.user.table
property, an arbitrary MIME type can be guessed.
Value parameters
- fallback
-
A fallback value in case no MIME type can be found
- file
-
The File for which to detect the MIME type
Attributes
Detects the MIME type of a given InputStream.
Detects the MIME type of a given InputStream.
When appropriate MIME Type can not be inferred, "application/octet-stream" is returned.
Value parameters
- fallback
-
A fallback value in case no MIME type can be found
- input
-
The InputStream for which to detect the MIME type
Attributes
Detects the MIME type of a given url.
Detects the MIME type of a given url.
When inappropriate MIME Type can not be inferred, "application/octet-stream" is returned.
This method guesses the MIME type using java.net.URLConnection.guessContentTypeFromName
. Therefore, by defining an arbitrary MIME type in the configuration file specified by the content.types.user.table
property, an arbitrary MIME type can be guessed.
Value parameters
- fallback
-
A fallback value in case no mime type can be found
- url
-
The url for which to detect the mime type