Package edu.harvard.hul.ois.fits.exceptions

Examples of edu.harvard.hul.ois.fits.exceptions.FitsConfigurationException


    FITS_TOOLS = FITS_HOME+"tools"+File.separator;
   
    try {
      config = new XMLConfiguration(FITS_XML+"fits.xml");
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+FITS_XML+"fits.xml",e);
    }
    try {
      mapper = new FitsXmlMapper();
    } catch (Exception  e) {
      throw new FitsConfigurationException("Error creating FITS XML Mapper",e);
    }
    validateToolOutput = config.getBoolean("output.validate-tool-output");
    externalOutputSchema   = config.getString("output.external-output-schema");
    internalOutputSchema   = config.getString("output.internal-output-schema");
   
    String consolidatorClass = config.getString("output.dataConsolidator[@class]");
    try {
      Class<?> c = Class.forName(consolidatorClass);
      consolidator = (ToolOutputConsolidator)c.newInstance();
    }
    catch(Exception e) {
      throw new FitsConfigurationException("Error initializing "+consolidatorClass,e);
    }
   
    toolbelt = new ToolBelt(FITS_XML+"fits.xml");
   
  }
View Full Code Here


  }
  */
 
  public FitsOutput examine(File input) throws FitsException
    if(!input.exists()) {
      throw new FitsConfigurationException(input+" does not exist or is not readable");
    }
       
    List<ToolOutput> toolResults = new ArrayList<ToolOutput>();
   
    //run file through each tool, catching exceptions thrown by tools
View Full Code Here

  public ToolBelt(String configFile) throws FitsConfigurationException {
    XMLConfiguration config = null;
    try {
      config = new XMLConfiguration(configFile);
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+configFile,e);
    }
 
    tools = new ArrayList<Tool>();
   
    // get number of tools
    int size = config.getList("tools.tool[@class]").size();
    // for each tools get the class path and any excluded extensions
    for(int i=0;i<size;i++) {
      String tClass = config.getString("tools.tool("+i+")[@class]");
      @SuppressWarnings("unchecked")
      List<String> excludes = config.getList("tools.tool("+i+")[@exclude-exts]");
      @SuppressWarnings("unchecked")
      List<String> includes = config.getList("tools.tool("+i+")[@include-exts]");
      Tool t = null;
      try {
        Class c = Class.forName(tClass);
        t = (Tool)c.newInstance();
      }
      catch(Exception e) {
        throw new FitsConfigurationException("Error initializing "+tClass,e);
      }
      if(t != null) {
        for(String ext : excludes) {
          t.addExcludedExtension(ext);
        }
View Full Code Here

    Hashtable mappings = new Hashtable();
    XMLConfiguration conf = null;
    try {
      conf = new XMLConfiguration(config);
    } catch (ConfigurationException e) {
      throw new FitsConfigurationException("Error reading "+config+"fits.xml",e);
    }
   
    List fields = conf.configurationsAt("map");
    for(Iterator it = fields.iterator(); it.hasNext();)  {
        HierarchicalConfiguration sub = (HierarchicalConfiguration) it.next();
View Full Code Here

    displayToolOutput = Fits.config.getBoolean("output.display-tool-output",false);
    SAXBuilder saxBuilder = new SAXBuilder();
    try {
      formatTree = saxBuilder.build(Fits.FITS_XML+"fits_format_tree.xml");
    } catch (Exception e) {
      throw new FitsConfigurationException("",e);
    }
    fitsNS = Namespace.getNamespace(Fits.XML_NAMESPACE);
  }
View Full Code Here

TOP

Related Classes of edu.harvard.hul.ois.fits.exceptions.FitsConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.