org.pentaho.reporting.libraries.repository
Interface MimeRegistry

All Known Implementing Classes:
DefaultMimeRegistry

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
 String getMimeType(ContentItem item)
          Queries the mime-type for a given content-item.
 String getSuffix(String mimeType)
          Returns the default suffix for files with the given content type.
 

Method Detail

getMimeType

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

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.