org.pentaho.reporting.libraries.repository

Interface MimeRegistry

public interface MimeRegistry

The MimeRegistry encodes content-type information and allows to detect or query the file type of a given content item. It also assists in naming files by providing a default suffix for a given mime-type.

Author: Thomas Morgner

Method Summary
StringgetMimeType(ContentItem item)
Queries the mime-type for a given content-item.
StringgetSuffix(String mimeType)
Returns the default suffix for files with the given content type.

Method Detail

getMimeType

public String getMimeType(ContentItem item)
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.

Parameters: item the content item for which Mime-Data should be queried.

Returns: the mime-type never null.

getSuffix

public String getSuffix(String mimeType)
Returns the default suffix for files with the given content type.

Parameters: mimeType the mime-type for which a suffix is queried.

Returns: the suffix, never null.