|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MimeTypeService
The MimeType Service maintains mappings between MIME types and the corresponding file name extensions, and between locales and character encodings. The mappings are typically defined in properties or files located in user's home directory, Java home directory or the current class jar depending on the implementation.
Field Summary | |
---|---|
static java.lang.String |
SERVICE_NAME
The name of the service. |
Method Summary | |
---|---|
java.lang.String |
getCharSet(java.util.Locale locale)
Gets the charset for a locale. |
java.lang.String |
getCharSet(java.util.Locale locale,
java.lang.String variant)
Gets the charset for a locale with a variant. |
java.lang.String |
getCharSet(java.lang.String key)
Gets the charset for a specified key. |
java.lang.String |
getCharSet(java.lang.String key,
java.lang.String def)
Gets the charset for a specified key. |
java.lang.String |
getContentType(java.io.File file)
Gets the MIME content type for a file as a string. |
java.lang.String |
getContentType(java.lang.String name)
Gets the MIME content type for a named file as a string. |
java.lang.String |
getContentType(java.lang.String ext,
java.lang.String def)
Gets the MIME content type for a file name extension as a string. |
java.lang.String |
getDefaultExtension(MimeType mime)
Gets the default file name extension for a MIME type. |
java.lang.String |
getDefaultExtension(java.lang.String type)
Gets the default file name extension for a MIME type. |
MimeType |
getMimeContentType(java.io.File file)
Gets the MIME content type for a file. |
MimeType |
getMimeContentType(java.lang.String name)
Gets the MIME content type for a named file. |
MimeType |
getMimeContentType(java.lang.String ext,
java.lang.String def)
Gets the MIME content type for a file name extension. |
void |
setCharSet(java.lang.String key,
java.lang.String charset)
Sets a locale-charset mapping. |
void |
setContentType(java.lang.String spec)
Sets a MIME content type mapping to extensions to the map. |
Methods inherited from interface org.apache.turbine.services.Service |
---|
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
---|
getInit, init, init, setInitableBroker, shutdown |
Field Detail |
---|
static final java.lang.String SERVICE_NAME
Method Detail |
---|
void setContentType(java.lang.String spec)
spec
- a MIME type extension specification to add.java.lang.String getContentType(java.io.File file)
file
- the file.
java.lang.String getContentType(java.lang.String name)
name
- the name of the file.
java.lang.String getContentType(java.lang.String ext, java.lang.String def)
ext
- the file name extension.def
- the default type if none is found.
MimeType getMimeContentType(java.io.File file)
file
- the file.
MimeType getMimeContentType(java.lang.String name)
name
- the name of the file.
MimeType getMimeContentType(java.lang.String ext, java.lang.String def)
ext
- the file name extension.def
- the default type if none is found.
java.lang.String getDefaultExtension(java.lang.String type)
type
- the MIME type as a string.
java.lang.String getDefaultExtension(MimeType mime)
mime
- the MIME type.
void setCharSet(java.lang.String key, java.lang.String charset)
key
- the key for the charset.charset
- the corresponding charset.java.lang.String getCharSet(java.util.Locale locale)
locale
- the locale.
java.lang.String getCharSet(java.util.Locale locale, java.lang.String variant)
locale
- the locale.variant
- a variant field.
java.lang.String getCharSet(java.lang.String key)
key
- the key for the charset.
java.lang.String getCharSet(java.lang.String key, java.lang.String def)
key
- the key for the charset.def
- the default charset if none is found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |