public class MagicParser extends Object implements DetectorProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_MAGIC_FILE
the default files used to create the Detectors
DEFAULT_MAGIC_FILE = "/etc/mime-magic"
|
| Constructor and Description |
|---|
MagicParser() |
MagicParser(String fileName)
Construct a new MagicParser with configuration file
|
| Modifier and Type | Method and Description |
|---|---|
List<Detector> |
getDetectors() |
static void |
main(String[] argv) |
protected int |
nextNonWhiteSpace(String s,
int startIndex) |
protected int |
nextWhiteSpace(String s) |
protected int |
nextWhiteSpace(String s,
int startIndex) |
boolean |
toXML(File f)
Write the current data structure to an XML file
|
boolean |
toXML(String path) |
public static final String DEFAULT_MAGIC_FILE
public MagicParser()
public MagicParser(String fileName)
fileName - File which contains the magic datapublic List<Detector> getDetectors()
getDetectors in interface DetectorProviderprotected int nextWhiteSpace(String s)
protected int nextWhiteSpace(String s, int startIndex)
protected int nextNonWhiteSpace(String s, int startIndex)
public boolean toXML(String path) throws IOException
IOExceptionpublic boolean toXML(File f) throws IOException
f - File to write toIOException - Throws an exception when parsing failedpublic static void main(String[] argv) throws IOException
IOExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}