Package com.saperion.util
Class MimeUtil
java.lang.Object
com.saperion.util.MimeUtil
This MimiUtil can be used to get a MIME type by filenames in a convenient
 way. Use it like this: MimeUtil.getMimeType("myFile.pdf").
- Author:
- sts
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe default MIME type to be used if no MIME type matches.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringgetFilename(String path) Deprecated.Will be removed in 8.1.static StringgetMimeType(String filename) Returns the MIME type matching the given filename.static StringgetMimeTypeByPath(String path) Returns the MIME type matching the given path (path/[/path...]/filename).protected static voidInitializes the MimetypesFileTypeMap used by this util.
- 
Field Details- 
DEFAULT_MIMETYPEThe default MIME type to be used if no MIME type matches.- See Also:
 
 
- 
- 
Method Details- 
initializeprotected static void initialize()Initializes the MimetypesFileTypeMap used by this util.
- 
getMimeTypeReturns the MIME type matching the given filename.- Parameters:
- filename- The filename to get the MIME type of.
- Returns:
- the MIME type or "application/octet-stream" if no matching MIME could be found or the util could not be initialized properly.
 
- 
getMimeTypeByPathReturns the MIME type matching the given path (path/[/path...]/filename).- Parameters:
- path- The filename to get the MIME type of.
- Returns:
- the MIME type or "application/octet-stream" if no matching MIME could be found or the util could not be initialized properly.
 
- 
getFilenameDeprecated.Will be removed in 8.1. UseMultipageDocUtil.getFilename(String)instead.Extracts and returns the filename of the given path. Strips the possible '@' postfix. - Parameters:
- path- The path+filename to be extract the filename from.
- Returns:
- The extracted filename.
 
 
-