org.mmbase.util.magicfile
Class MagicParser
java.lang.Object
|
+--org.mmbase.util.magicfile.MagicParser
- All Implemented Interfaces:
- DetectorProvider
- public class MagicParser
- extends java.lang.Object
- implements DetectorProvider
This Parser translates the configuration file of UNIX's file to a
list of Detectors (and to a magic.xml) Perhaps it's easier to
rewrite this stuff to perl or something like that.
|
Method Summary |
java.util.List |
getDetectors()
|
protected int |
nextNonWhiteSpace(java.lang.String s,
int startIndex)
|
protected int |
nextWhiteSpace(java.lang.String s)
|
protected int |
nextWhiteSpace(java.lang.String s,
int startIndex)
|
boolean |
toXML(java.io.File f)
Write the current datastructure to an XML file
XXX Ugly and hardcoded paths |
boolean |
toXML(java.lang.String path)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MagicParser
public MagicParser()
getDetectors
public java.util.List getDetectors()
- Specified by:
getDetectors in interface DetectorProvider
nextWhiteSpace
protected int nextWhiteSpace(java.lang.String s)
nextWhiteSpace
protected int nextWhiteSpace(java.lang.String s,
int startIndex)
nextNonWhiteSpace
protected int nextNonWhiteSpace(java.lang.String s,
int startIndex)
toXML
public boolean toXML(java.lang.String path)
throws java.io.IOException
toXML
public boolean toXML(java.io.File f)
throws java.io.IOException
- Write the current datastructure to an XML file
XXX Ugly and hardcoded paths
MMBase build 1.6.5.20030923