| java.lang.Object org.mmbase.util.magicfile.MagicFile
MagicFile | public class MagicFile (Code) | | Tries to determine the mime-type of a byte array (or a file).
author: cjr@dds.nl author: Michiel Meeuwissen version: $Id: MagicFile.java,v 1.4 2007/03/02 21:04:16 nklasens Exp $ |
BUFSIZE | final protected static int BUFSIZE(Code) | | |
getDetectors | public List<Detector> getDetectors()(Code) | | Returns a list of detectors used by this MagicFile instance
|
getInstance | public static MagicFile getInstance()(Code) | | Return the current instance of MagicFile. If no instance exists,
one is created.
|
getMimeType | protected String getMimeType(File file) throws IOException(Code) | | Parameters: file - Location of file to be checked Type of the file as determined by the magic file |
getMimeType | public String getMimeType(byte[] input)(Code) | | Tests the byte[] array for the mime type.
The found mime-type or FAILED |
main | public static void main(String[] argv)(Code) | | e.g.: java -Dmmbase.config=/home/mmbase/mmbase-app/WEB-INF/config org.mmbase.util.MagicFile test.doc
|
mimeTypeToExtension | public String mimeTypeToExtension(String mimeType)(Code) | | Given a mime-type string, this function tries to create a common extension for it.
An extension (without the dot), or an empty string if the mime-type is unknown. since: MMBase-1.7.1 |
|
|