|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
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 String |
DEFAULT_MIMETYPE
|
Method Summary | |
---|---|
List<String> |
getExtensionsFromMimetypeName(String mimetypeName)
Returns the extension for given mimetype. |
MimetypeEntry |
getMimetypeEntryByMimeType(String mimetype)
Gets a mimetype entry given the normalized mimetype. |
MimetypeEntry |
getMimetypeEntryByName(String name)
Gets a mimetype entry by name. |
String |
getMimetypeFromBlob(Blob blob)
Returns the mime type from a given stream. |
String |
getMimetypeFromBlobWithDefault(Blob blob,
String defaultMimetype)
Returns the mime type from a given blob or provided default if not possible. |
String |
getMimetypeFromFile(File file)
Returns the mime type given a file. |
String |
getMimetypeFromFilenameAndBlobWithDefault(String filename,
Blob blob,
String defaultMimetype)
Finds the mimetype of some content according to its filename and / or binary content. |
String |
getMimetypeFromStream(InputStream stream)
Returns the mime type from a given stream. |
String |
getMimetypeFromStreamWithDefault(InputStream is,
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,
String filename)
Update the mimetype field of a Blob based on the provided filename with fallback to binary sniffing. |
Field Detail |
---|
static final String DEFAULT_MIMETYPE
Method Detail |
---|
String getMimetypeFromStream(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 expectedString 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 expectedString getMimetypeFromBlobWithDefault(Blob blob, String defaultMimetype) throws MimetypeDetectionException
MimetypeDetectionException
String getMimetypeFromStreamWithDefault(InputStream is, String defaultMimetype) throws MimetypeDetectionException
MimetypeDetectionException
String getMimetypeFromFile(File file) throws MimetypeNotFoundException, MimetypeDetectionException
MimetypeNotFoundException
- if mimetype sniffing failed
MimetypeDetectionException
- if unexpected problem prevent the
detection to work as expectedList<String> getExtensionsFromMimetypeName(String mimetypeName)
mimetypeName
- the mimetype name.
MimetypeEntry getMimetypeEntryByName(String name)
name
- the mimetype name.
MimetypeEntry getMimetypeEntryByMimeType(String mimetype)
mimetype
- the normalized mimetype
String getMimetypeFromFilenameAndBlobWithDefault(String filename, Blob blob, 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, 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 ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |