|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MimetypeRegistry
MimetypeEntry registry.
Flexible registry of mimetypes.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_MIMETYPE
|
Method Summary | |
---|---|
java.util.List<java.lang.String> |
getExtensionsFromMimetypeName(java.lang.String mimetypeName)
Returns the extension for given mimetype. |
MimetypeEntry |
getMimetypeEntryByMimeType(java.lang.String mimetype)
Gets a mimetype entry given the normalized mimetype. |
MimetypeEntry |
getMimetypeEntryByName(java.lang.String name)
Gets a mimetype entry by name. |
java.lang.String |
getMimetypeFromBlob(Blob blob)
Returns the mime type from a given stream. |
java.lang.String |
getMimetypeFromBlobWithDefault(Blob blob,
java.lang.String defaultMimetype)
Returns the mime type from a given blob or provided default if not possible. |
java.lang.String |
getMimetypeFromFile(java.io.File file)
Returns the mime type given a file. |
java.lang.String |
getMimetypeFromFilenameAndBlobWithDefault(java.lang.String filename,
Blob blob,
java.lang.String defaultMimetype)
Finds the mimetype of some content according to its filename and / or binary content. |
java.lang.String |
getMimetypeFromStream(java.io.InputStream stream)
Returns the mime type from a given stream. |
java.lang.String |
getMimetypeFromStreamWithDefault(java.io.InputStream is,
java.lang.String defaultMimetype)
Returns the mime type from a given stream or provided default if not possible. |
Blob |
updateMimetype(Blob blob)
Update the mimetype field of a Blob based on the embedded filename with fallback to binary sniffing. |
Blob |
updateMimetype(Blob blob,
java.lang.String filename)
Update the mimetype field of a Blob based on the provided filename with fallback to binary sniffing. |
Field Detail |
---|
static final java.lang.String DEFAULT_MIMETYPE
Method Detail |
---|
java.lang.String getMimetypeFromStream(java.io.InputStream stream) throws MimetypeNotFoundException, MimetypeDetectionException
MimetypeNotFoundException
- if mimetype sniffing failed to identify
a registered mime type
MimetypeDetectionException
- if unexpected problem prevent the
detection to work as expectedjava.lang.String getMimetypeFromBlob(Blob blob) throws MimetypeNotFoundException, MimetypeDetectionException
MimetypeNotFoundException
- if mimetype sniffing failed to identify
a registered mime type
MimetypeDetectionException
- if unexpected problem prevent the
detection to work as expectedjava.lang.String getMimetypeFromBlobWithDefault(Blob blob, java.lang.String defaultMimetype) throws MimetypeDetectionException
MimetypeDetectionException
java.lang.String getMimetypeFromStreamWithDefault(java.io.InputStream is, java.lang.String defaultMimetype) throws MimetypeDetectionException
MimetypeDetectionException
java.lang.String getMimetypeFromFile(java.io.File file) throws MimetypeNotFoundException, MimetypeDetectionException
MimetypeNotFoundException
- if mimetype sniffing failed
MimetypeDetectionException
- if unexpected problem prevent the
detection to work as expectedjava.util.List<java.lang.String> getExtensionsFromMimetypeName(java.lang.String mimetypeName)
mimetypeName
- the mimetype name.
MimetypeEntry getMimetypeEntryByName(java.lang.String name)
name
- the mimetype name.
MimetypeEntry getMimetypeEntryByMimeType(java.lang.String mimetype)
mimetype
- the normalized mimetype
java.lang.String getMimetypeFromFilenameAndBlobWithDefault(java.lang.String filename, Blob blob, java.lang.String defaultMimetype) throws MimetypeDetectionException
filename
- extension to analyzeblob
- content to be analyzed if filename is ambiguousdefaultMimetype
- defaultMimeType to be used if no found
MimetypeDetectionException
Blob updateMimetype(Blob blob, java.lang.String filename) throws MimetypeDetectionException
blob
- content to be analyzed if filename is ambiguousfilename
- with extension to analyze
MimetypeDetectionException
Blob updateMimetype(Blob blob) throws MimetypeDetectionException
blob
- content to be analyzed if filename is ambiguous
MimetypeDetectionException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |