|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.semanticdesktop.aperture.mime.identifier.magic.MagicMimeTypeIdentifier
public class MagicMimeTypeIdentifier
Determines the MIME type of a binary resource based on magic number-based heuristics.
Constructor Summary | |
---|---|
MagicMimeTypeIdentifier()
|
|
MagicMimeTypeIdentifier(String definitionsResource)
|
Method Summary | |
---|---|
List |
getExtensionsFor(String mimeType)
Utility method for listing all known file extensions of the specified MIME type. |
protected ArrayList |
getMimeTypeDescriptions()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MagicMimeTypeIdentifier()
public MagicMimeTypeIdentifier(String definitionsResource)
Method Detail |
---|
protected ArrayList getMimeTypeDescriptions()
public String identify(byte[] firstBytes, String fileName, URI uri)
MimeTypeIdentifier
identify
in interface MimeTypeIdentifier
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.
MimeTypeIdentifier.getMinArrayLength()
public int getMinArrayLength()
MimeTypeIdentifier
getMinArrayLength
in interface MimeTypeIdentifier
MimeTypeIdentifier.identify(byte[], String, URI)
public List getExtensionsFor(String mimeType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |