Class MagicNumberReader


  • public class MagicNumberReader
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.apache.commons.logging.Log log  
      static java.lang.String MAGIC_NUMBER_FILE  
      java.lang.String mMagicNumberFile  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static ClassMap[] parse​(java.io.InputStream stream)  
      protected static ClassMap parseClassData​(org.w3c.dom.Node protocol)  
      ClassMap[] readMagicNumberMapping()
      try to read the magic number configuration file as a Resource form the classpath using getResourceAsStream if this fails this method tries to read the configuration file from mMagicNumberFile using a FileInputStream (not in classpath but somewhere else in the disk)
      void setFilename​(java.lang.String file)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAGIC_NUMBER_FILE

        public static final java.lang.String MAGIC_NUMBER_FILE
        See Also:
        Constant Field Values
      • mMagicNumberFile

        public java.lang.String mMagicNumberFile
      • log

        protected static final org.apache.commons.logging.Log log
    • Constructor Detail

      • MagicNumberReader

        public MagicNumberReader()
    • Method Detail

      • setFilename

        public void setFilename​(java.lang.String file)
      • readMagicNumberMapping

        public ClassMap[] readMagicNumberMapping()
        try to read the magic number configuration file as a Resource form the classpath using getResourceAsStream if this fails this method tries to read the configuration file from mMagicNumberFile using a FileInputStream (not in classpath but somewhere else in the disk)
        Returns:
        an array of ClassMap objects that where parsed from the file (if found) or an empty array if file not found or had en exception
      • parse

        protected static ClassMap[] parse​(java.io.InputStream stream)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseClassData

        protected static ClassMap parseClassData​(org.w3c.dom.Node protocol)
                                          throws java.io.IOException
        Throws:
        java.io.IOException