public final class MimeUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MIMETYPE
The default MIME type to be used if no MIME type matches.
|
protected static MimetypesFileTypeMap |
mimeMap
The MimetypesFileTypeMap used by this util.
|
Modifier and Type | Method and Description |
---|---|
static String |
decodeFilename(javax.servlet.http.HttpServletRequest request,
String filename)
Decodes a filename decoded by the
encodeFilename(HttpServletRequest, String) method. |
static String |
decodeFilename(String filename)
Decodes a filename encoded by the
encodeFilename(String) method. |
static String |
encodeFilename(javax.servlet.http.HttpServletRequest request,
String filename)
Encodes a filename so that it is save for downloading in different
browsers.
|
static String |
encodeFilename(String filename)
Encodes a filename so that it is save for downloading in different
browsers.
|
static String |
getMimeType(String filename)
Returns the MIME type matching the given filename.
|
protected static void |
initialize()
Initializes the MimetypesFileTypeMap used by this util.
|
public static final String DEFAULT_MIMETYPE
protected static MimetypesFileTypeMap mimeMap
protected static void initialize()
public static String getMimeType(String filename)
filename
- The filename to get the MIME type of.public static String encodeFilename(String filename) throws UnsupportedEncodingException
filename
- the filename to encodeUnsupportedEncodingException
- if the encoding used to encode the filename is unknownpublic static String decodeFilename(String filename) throws UnsupportedEncodingException
encodeFilename(String)
method.filename
- the filename to decodedUnsupportedEncodingException
- if the encoding used to decode the filename is unknownpublic static String encodeFilename(javax.servlet.http.HttpServletRequest request, String filename) throws UnsupportedEncodingException
request
- the current requestfilename
- the filename to encodeUnsupportedEncodingException
- if the encoding used to encode the filename is unknownpublic static String decodeFilename(javax.servlet.http.HttpServletRequest request, String filename) throws UnsupportedEncodingException
encodeFilename(HttpServletRequest, String)
method.request
- the current requestfilename
- the filename to decodedUnsupportedEncodingException
- if the encoding used to decode the filename is unknownCopyright © 2021 Hyland Software Germany GmbH. All rights reserved.