@AlfrescoPublicApi
public interface MimetypeService
Modifier and Type | Method and Description |
---|---|
ContentCharsetFinder |
getContentCharsetFinder()
Provides the system default charset finder.
|
Map<String,String> |
getDisplaysByExtension()
Get all human readable mimetype descriptions indexed by mimetype extension
|
Map<String,String> |
getDisplaysByMimetype()
Get all human readable mimetype descriptions indexed by mimetype
|
String |
getExtension(String mimetype)
Get the extension for the specified mimetype
|
Map<String,String> |
getExtensionsByMimetype()
Get all mimetype extensions indexed by mimetype
|
String |
getMimetype(String extension)
Get the mimetype for the specified extension
|
String |
getMimetypeIfNotMatches(ContentReader reader)
Use detection heuristics to check if the mime type of the document really
matches what it claims to be.
|
List<String> |
getMimetypes()
Get all mimetypes
|
Collection<String> |
getMimetypes(String extension)
Returns a collection of mimetypes ordered by extension.
|
Map<String,String> |
getMimetypesByExtension()
Get all mimetypes indexed by extension
|
String |
guessMimetype(String filename)
Provides a non-null best guess of the appropriate mimetype given a
filename, based entirely on the file extension.
|
String |
guessMimetype(String filename,
ContentReader reader)
Provides a non-null best guess of the appropriate mimetype for a
given file.
|
String |
guessMimetype(String filename,
InputStream input)
Provides a non-null best guess of the appropriate mimetype for a
given file.
|
boolean |
isText(String mimetype)
Check if a given mimetype represents a text format.
|
@NotAuditable String getExtension(String mimetype)
mimetype
- a valid mimetype@NotAuditable String getMimetype(String extension)
extension
- a valid file extension@NotAuditable Map<String,String> getDisplaysByExtension()
@NotAuditable Map<String,String> getDisplaysByMimetype()
@NotAuditable Map<String,String> getExtensionsByMimetype()
@NotAuditable Map<String,String> getMimetypesByExtension()
@NotAuditable boolean isText(String mimetype)
mimetype
- the mimetype to check@NotAuditable List<String> getMimetypes()
@NotAuditable String guessMimetype(String filename)
guessMimetype(String, ContentReader)
instead.filename
- the name of the file with an optional file extension@NotAuditable String guessMimetype(String filename, ContentReader reader)
filename
- the name of the file with an optional file extensionreader
- a reader for the content of the file@NotAuditable String guessMimetype(String filename, InputStream input)
filename
- the name of the file with an optional file extensioninput
- an input stream for the content@NotAuditable String getMimetypeIfNotMatches(ContentReader reader)
@NotAuditable ContentCharsetFinder getContentCharsetFinder()
@NotAuditable Collection<String> getMimetypes(String extension)
extension
- to restrict the collection to one entryCopyright © 2005–2016 Alfresco Software. All rights reserved.