|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jmimemagic.Magic
This class is the primary class for jMimeMagic
Constructor Summary | |
Magic()
constructor |
Method Summary | |
static MagicMatch |
getMagicMatch(byte[] data)
get a match from a stream of data |
static MagicMatch |
getMagicMatch(byte[] data,
boolean onlyMimeMatch)
get a match from a stream of data |
static MagicMatch |
getMagicMatch(java.io.File file,
boolean extensionHints)
get a match from a file |
static MagicMatch |
getMagicMatch(java.io.File file,
boolean extensionHints,
boolean onlyMimeMatch)
get a match from a file |
static java.util.Collection |
getMatchers()
return the parsed MagicMatch objects that were created from the magic.xml definitions |
static void |
initialize()
create a parser and initialize it |
static void |
main(java.lang.String[] args)
DOCUMENT ME! |
static void |
printMagicFile(java.io.PrintStream stream)
print the contents of a magic file |
static void |
printMagicMatch(java.io.PrintStream stream,
MagicMatch match,
java.lang.String spacing)
print a magic match |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Magic()
Method Detail |
public static void initialize() throws MagicParseException
MagicParseException
- DOCUMENT ME!public static java.util.Collection getMatchers() throws MagicParseException
MagicParseException
- DOCUMENT ME!public static MagicMatch getMagicMatch(byte[] data) throws MagicParseException, MagicMatchNotFoundException, MagicException
data
- DOCUMENT ME!
MagicParseException
- DOCUMENT ME!
MagicMatchNotFoundException
- DOCUMENT ME!
MagicException
- DOCUMENT ME!public static MagicMatch getMagicMatch(byte[] data, boolean onlyMimeMatch) throws MagicParseException, MagicMatchNotFoundException, MagicException
data
- DOCUMENT ME!onlyMimeMatch
- DOCUMENT ME!
MagicParseException
- DOCUMENT ME!
MagicMatchNotFoundException
- DOCUMENT ME!
MagicException
- DOCUMENT ME!public static MagicMatch getMagicMatch(java.io.File file, boolean extensionHints) throws MagicParseException, MagicMatchNotFoundException, MagicException
file
- the file to match content inextensionHints
- whether or not to use extension to optimize order of content tests
MagicParseException
- DOCUMENT ME!
MagicMatchNotFoundException
- DOCUMENT ME!
MagicException
- DOCUMENT ME!public static MagicMatch getMagicMatch(java.io.File file, boolean extensionHints, boolean onlyMimeMatch) throws MagicParseException, MagicMatchNotFoundException, MagicException
file
- the file to match content inextensionHints
- whether or not to use extension to optimize order of content testsonlyMimeMatch
- only try to get mime type, no submatches are processed when true
MagicParseException
- DOCUMENT ME!
MagicMatchNotFoundException
- DOCUMENT ME!
MagicException
- DOCUMENT ME!public static void printMagicFile(java.io.PrintStream stream) throws MagicParseException
stream
- DOCUMENT ME!
MagicParseException
- DOCUMENT ME!public static void printMagicMatch(java.io.PrintStream stream, MagicMatch match, java.lang.String spacing)
stream
- DOCUMENT ME!match
- DOCUMENT ME!spacing
- DOCUMENT ME!public static void main(java.lang.String[] args)
args
- DOCUMENT ME!
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |