public class ERMimeTypeManager extends Object
Name | Description |
---|---|
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.
|
String |
extensionForFileName(String fileName)
Returns the extension for the given filename.
|
ERMimeType |
mimeTypeForExtension(String extension,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given file extension, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForFile(File file,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given file, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForFileName(String fileName,
boolean exceptionIfNotFound)
Returns the ERMimeType for the given file name, optionally throwing an exception
if the type isn't found.
|
ERMimeType |
mimeTypeForMimeTypeString(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(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 String |
primaryExtension(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 String primaryExtension(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 String extensionForFileName(String fileName)
fileName
- the filenamefileName
- - ファイル名public ERMimeType mimeTypeForFileName(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(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(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(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(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 – 2024 Project Wonder.