org.semanticdesktop.aperture.mime.identifier
Interface MimeTypeIdentifier

All Known Implementing Classes:
MagicMimeTypeIdentifier

public interface MimeTypeIdentifier

Identifies the MIME type of a binary resource. Implementations typically use heuristics such as magic numbers, file name extension, etc. to perform the identification.


Method Summary
 int getMinArrayLength()
          Returns the minimum length needed by the identify method for its array parameter.
 String identify(byte[] firstBytes, String fileName, URI uri)
          Identifies the MIME type of a binary resource based on the specified characteristics.
 

Method Detail

identify

String identify(byte[] firstBytes,
                String fileName,
                URI uri)
Identifies the MIME type of a binary resource based on the specified characteristics. Any of the parameters may be null.

Parameters:
firstBytes - The first bytes of the resource's binary contents. The getMinArrayLength method will return how big this array should minimally be for this MimeTypeIdentifier to do its job.
fileName - The resource's file name.
uri - the URI used to typically identify the resource.
Returns:
the detected MIME type of the resource, or null when the MIME type could not be determined.
See Also:
getMinArrayLength()

getMinArrayLength

int getMinArrayLength()
Returns the minimum length needed by the identify method for its array parameter.

See Also:
identify(byte[], String, URI)


Copyright © 2010 Aperture Development Team. All Rights Reserved.