public class ERMimeTypeManager
extends java.lang.Object
| Properties | |
er.attachment.mimeTypes | er.attachment.mimeTypes |
er.attachment.additionalMimeTypes | er.attachment.additionalMimeTypes |
er.attachment.mimeType.[mimeType].name | er.attachment.mimeType.[mimeType].name |
er.attachment.mimeType.[mimeType].uti | er.attachment.mimeType.[mimeType].uti |
er.attachment.mimeType.[mimeType].extensions | er.attachment.mimeType.[mimeType].extensions |
| Modifier and Type | Method and Description |
|---|---|
void |
addMimeType(ERMimeType mimeType)
Adds a mime type definition to the manager.
|
void |
clearMimeTypes()
Removes all the mime types from this manager.
|
java.lang.String |
extensionForFileName(java.lang.String fileName)
Returns the extension for the given filename.
|
ERMimeType |
mimeTypeForExtension(java.lang.String extension,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given file extension, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForFile(java.io.File file,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given file, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForFileName(java.lang.String fileName,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given file name, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForMimeTypeString(java.lang.String mimeType,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given mime type string, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForUTI(java.lang.String uti,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given UTI, optionally throwing an exception
if the type isn't found.
|
static ERMimeTypeManager |
mimeTypeManager()
Returns the singleton mime type manager.
|
static java.lang.String |
primaryExtension(java.lang.String mimeTypeStr)
Returns the primary extension for the given mime type.
|
void |
removeMimeType(ERMimeType mimeType)
Removes the given mime type definition from this manager.
|
public static ERMimeTypeManager mimeTypeManager()
public static java.lang.String primaryExtension(java.lang.String mimeTypeStr)
mimeTypeStr - the mime type string to lookupmimeTypeStr - - ルックアップする MIME タイプpublic void clearMimeTypes()
public void removeMimeType(ERMimeType mimeType)
mimeType - the mime type to remove
指定の MIME タイプをマネージャより削除します。mimeType - - 削除する MIME タイプ
public void addMimeType(ERMimeType mimeType)
mimeType - the mime type to add
指定の MIME タイプをマネージャに追加します。mimeType - - 追加する MIME タイプ
public java.lang.String extensionForFileName(java.lang.String fileName)
fileName - the filenamefileName - - ファイル名public ERMimeType mimeTypeForFileName(java.lang.String fileName, boolean exceptionIfNotFound)
fileName - the file name to lookupexceptionIfNotFound - if true, a NoSuchElementException exception is thrown if the mime type isn't foundfileName - - ルックアップするファイル名exceptionIfNotFound - - true の場合には見つからない時に NoSuchElementException を発生させます。public ERMimeType mimeTypeForFile(java.io.File file, boolean exceptionIfNotFound)
file - the file to lookupexceptionIfNotFound - if true, a NoSuchElementException exception is thrown if the mime type isn't foundfile - - ルックアップするファイルexceptionIfNotFound - - true の場合には見つからない時に NoSuchElementException を発生させます。public ERMimeType mimeTypeForMimeTypeString(java.lang.String mimeType, boolean exceptionIfNotFound)
mimeType - the mime type string to lookupexceptionIfNotFound - if true, a NoSuchElementException exception is thrown if the mime type isn't foundmimeType - - ルックアップする MIME タイプexceptionIfNotFound - - true の場合には見つからない時に NoSuchElementException を発生させます。public ERMimeType mimeTypeForExtension(java.lang.String extension, boolean exceptionIfNotFound)
extension - the file extension to lookupexceptionIfNotFound - if true, a NoSuchElementException exception is thrown if the mime type isn't foundextension - - ルックアップする拡張子exceptionIfNotFound - - true の場合には見つからない時に NoSuchElementException を発生させます。public ERMimeType mimeTypeForUTI(java.lang.String uti, boolean exceptionIfNotFound)
uti - the UTI to lookupexceptionIfNotFound - if true, a NoSuchElementException exception is thrown if the mime type isn't founduti - - ルックアップする UTIexceptionIfNotFound - - true の場合には見つからない時に NoSuchElementException を発生させます。Copyright © 2002 – 2022 Project Wonder.