|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MimeTypeService
The MimeTypeService
TODO
This interface is not intended to be implemented by bundles. It is implemented by this bundle and may be used by client bundles.
Method Summary | |
---|---|
java.lang.String |
getExtension(java.lang.String mimeType)
Returns the primary name extension to which the given mimeType maps. |
java.lang.String |
getMimeType(java.lang.String name)
Returns the MIME type of the extension of the given name . |
void |
registerMimeType(java.io.InputStream mimeTabStream)
|
void |
registerMimeType(java.lang.String mimeType,
java.lang.String... extensions)
|
Method Detail |
---|
java.lang.String getMimeType(java.lang.String name)
name
.
The extension is the part of the name after the last dot. If the name
does not contain a dot, the name as a whole is assumed to be the
extension.
name
- The name for which the MIME type is to be returned.
name
is
null
, null
is returned.getExtension(String)
java.lang.String getExtension(java.lang.String mimeType)
mimeType
maps. The returned extension must map to the
given mimeType
when fed to the
getMimeType(String)
method. In other words, the expression
mimeType.equals(getMimeType(getExtension(mimeType)))
must
always be true
for any non-null
MIME type.
A MIME type may be mapped to multiple extensions (e.g.
text/plain
to txt
, log
,
...). This method is expected to returned one of those extensions. It is
up to the implementation to select an appropriate extension if multiple
mappings exist for a single MIME type.
mimeType
- The MIME type whose primary extension is requested.
null
if no such mapping exists.getMimeType(String)
void registerMimeType(java.lang.String mimeType, java.lang.String... extensions)
void registerMimeType(java.io.InputStream mimeTabStream) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |