SMILA 1.0 API documentation

org.eclipse.smila.common.mimetype
Interface MimeTypeIdentifier

All Known Implementing Classes:
SimpleMimeTypeIdentifier

public interface MimeTypeIdentifier

Service interface to identify a MimeType.


Method Summary
 java.lang.String identify(byte[] data)
          Identifies a MimeType based on the given data.
 java.lang.String identify(byte[] data, java.lang.String extension)
          Identifies a MimeType based on the given data and file extension.
 java.lang.String identify(java.lang.String extension)
          Identifies a MimeType based on the file extension.
 

Method Detail

identify

java.lang.String identify(byte[] data)
                          throws MimeTypeParseException
Identifies a MimeType based on the given data.

Parameters:
data - a byte[] containing the data
Returns:
the detected MimeType
Throws:
MimeTypeParseException - if any error occurs

identify

java.lang.String identify(java.lang.String extension)
                          throws MimeTypeParseException
Identifies a MimeType based on the file extension.

Parameters:
extension - the extension of the filename
Returns:
the detected MimeType
Throws:
MimeTypeParseException - if any error occurs

identify

java.lang.String identify(byte[] data,
                          java.lang.String extension)
                          throws MimeTypeParseException
Identifies a MimeType based on the given data and file extension.

Parameters:
data - a byte[] containing the data
extension - the extension of the filename
Returns:
the detected MimeType
Throws:
MimeTypeParseException - if any error occurs

SMILA 1.0 API documentation