Class DefaultMimeRegistry
java.lang.Object
org.pentaho.reporting.libraries.repository.DefaultMimeRegistry
- All Implemented Interfaces:
Serializable
,MimeRegistry
The default-mime registry contains a list of well-known file types and returns mime-information for them. This
implementation recognizes a couple of image types and CSS, XML and HTML files. The content is recognized by its
filename, not by its actual content.
- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMimeType
(String filename) Queries the mime-type for a given filename.getMimeType
(ContentItem item) Queries the mime-type for a given content-item.Returns the default suffix for files with the given content type.
-
Constructor Details
-
DefaultMimeRegistry
public DefaultMimeRegistry()Default Constructor.
-
-
Method Details
-
getMimeType
Queries the mime-type for a given content-item. Some repositories store mime-type information along with the content data, while others might resort to heuristics based on the filename or actual data stored in the item.- Specified by:
getMimeType
in interfaceMimeRegistry
- Parameters:
item
- the content item for which Mime-Data should be queried.- Returns:
- the mime-type never null.
-
getMimeType
Queries the mime-type for a given filename. Some repositories store mime-type information along with the content data, while others might resort to heuristics based on the filename or actual data stored in the item.- Parameters:
filename
- the content item for which Mime-Data should be queried.- Returns:
- the mime-type never null.
-
getSuffix
Returns the default suffix for files with the given content type.- Specified by:
getSuffix
in interfaceMimeRegistry
- Parameters:
mimeType
- the mime-type for which a suffix is queried.- Returns:
- the suffix, never null.
-