Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.service.cmr.repository
Interface MimetypeService

@org.alfresco.api.AlfrescoPublicApi
public interface MimetypeService
This service interface provides support for Mimetypes.
Author:
Derek Hulley

Method Summary
org.alfresco.repo.content.encoding.ContentCharsetFinder
getContentCharsetFinder()
          Provides the system default charset finder.
getDisplaysByExtension()
          Get all human readable mimetype descriptions indexed by mimetype extension
getDisplaysByMimetype()
          Get all human readable mimetype descriptions indexed by mimetype
getExtension(String mimetype)
          Get the extension for the specified mimetype
getExtensionsByMimetype()
          Get all mimetype extensions indexed by mimetype
getMimetype(String extension)
          Get the mimetype for the specified extension
getMimetypeIfNotMatches(ContentReader reader)
          Use detection heuristics to check if the mime type of the document really matches what it claims to be.
getMimetypes()
          Get all mimetypes
getMimetypes(String extension)
          Returns a collection of mimetypes ordered by extension.
getMimetypesByExtension()
          Get all mimetypes indexed by extension
guessMimetype(String filename)
          Provides a non-null best guess of the appropriate mimetype given a filename, based entirely on the file extension.
guessMimetype(String filename, ContentReader reader)
          Provides a non-null best guess of the appropriate mimetype for a given file.
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.
Method Detail
getExtension
@NotAuditable
String getExtension(String mimetype)
Get the extension for the specified mimetype
Parameters:
mimetype - a valid mimetype
Returns:
Returns the default extension for the mimetype

getMimetype
@NotAuditable
String getMimetype(String extension)
Get the mimetype for the specified extension
Parameters:
extension - a valid file extension
Returns:
Returns a valid mimetype if found, or null if does not exist

getDisplaysByExtension
@NotAuditable
Map<StringgetDisplaysByExtension()
Get all human readable mimetype descriptions indexed by mimetype extension
Returns:
the map of displays indexed by extension

getDisplaysByMimetype
@NotAuditable
Map<StringgetDisplaysByMimetype()
Get all human readable mimetype descriptions indexed by mimetype
Returns:
the map of displays indexed by mimetype

getExtensionsByMimetype
@NotAuditable
Map<StringgetExtensionsByMimetype()
Get all mimetype extensions indexed by mimetype
Returns:
the map of extension indexed by mimetype

getMimetypesByExtension
@NotAuditable
Map<StringgetMimetypesByExtension()
Get all mimetypes indexed by extension
Returns:
the map of mimetypes indexed by extension

isText
@NotAuditable
boolean isText(String mimetype)
Check if a given mimetype represents a text format.
Parameters:
mimetype - the mimetype to check
Returns:
Returns true if it is text

getMimetypes
@NotAuditable
List<StringgetMimetypes()
Get all mimetypes
Returns:
all mimetypes

guessMimetype
@NotAuditable
String guessMimetype(String filename)
Provides a non-null best guess of the appropriate mimetype given a filename, based entirely on the file extension. Because file extensions can be wrong, you are strongly advised to use guessMimetype(String, ContentReader) instead.
Parameters:
filename - the name of the file with an optional file extension
Returns:
Returns the best guess mimetype or the mimetype for straight binary files if no extension could be found.

guessMimetype
@NotAuditable
String guessMimetype(String filename,
                     ContentReader reader)
Provides a non-null best guess of the appropriate mimetype for a given file. Uses a mixture of file name and file content logic to identify the mimetype for the file, and will usually manage to identify files with incorrect extensions.
Parameters:
filename - the name of the file with an optional file extension
reader - a reader for the content of the file
Returns:
Returns the best guess mimetype or the mimetype for straight binary files if no extension could be found.

guessMimetype
@NotAuditable
String guessMimetype(String filename,
                     InputStream input)
Provides a non-null best guess of the appropriate mimetype for a given file. Uses a mixture of file name and file content logic to identify the mimetype for the file, and will usually manage to identify files with incorrect extensions.
Parameters:
filename - the name of the file with an optional file extension
input - an input stream for the content
Returns:
Returns the best guess mimetype or the mimetype for straight binary files if no extension could be found.

getMimetypeIfNotMatches
@NotAuditable
String getMimetypeIfNotMatches(ContentReader reader)
Use detection heuristics to check if the mime type of the document really matches what it claims to be. This is typically used when a transformation or metadata extractions fails, and you want to know if someone has renamed a file and consequently it has the wrong mime type.
Returns:
Null if the mime type seems ok, otherwise the mime type it probably is

getContentCharsetFinder
@NotAuditable
org.alfresco.repo.content.encoding.ContentCharsetFinder getContentCharsetFinder()
Provides the system default charset finder.
Returns:
Returns a character set finder that can be used to decode streams in order to get the encoding.
Since:
2.1

getMimetypes
@NotAuditable
Collection<StringgetMimetypes(String extension)
Returns a collection of mimetypes ordered by extension.
Parameters:
extension - to restrict the collection to one entry

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2018 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.