Package org.iupac.goldbook.goldify.bases

Examples of org.iupac.goldbook.goldify.bases.GoldifyException


        firstLine += (char)currentChar;
        currentChar = inStream.read();
      }
      String[] parts = firstLine.split(" ");
      if (parts.length < 2)
        throw new GoldifyException("Improper format of header line. It should be '# length', it was '"+firstLine+"'");
      else if (!(parts[0].equals("#") || parts[0].equals("!"))) {
        throw new GoldifyException("Header line should start with either w'#' or '!'.");
      }
      int multiply = 1;
      if (parts[0].equals("!"))
        multiply = -1;
      return multiply * Integer.parseInt(parts[1]);
 
View Full Code Here


              firstLine += (char)currentChar;
              currentChar = inStream.read();
            }
            String[] parts = firstLine.split(" ");
            if (parts.length < 4)
              throw new GoldifyException("Improper format of header line. It should be '# format length charset', it was '"+firstLine+"'");
            else if (!parts[0].equals("#")) {
              //System.err.println(parts[0]);
              throw new GoldifyException("Header line should start with the '#' character.");
            }
            String format = parts[1];
            int len = Integer.parseInt(parts[2]);
            String charset = parts[3];
            //System.out.format("Allocating %d buffer; charset=%s\n", len, charset);
View Full Code Here

 
  public DocumentProcessor getProcessorForType(String type) throws GoldifyException {
    if (typeToProcessor.containsKey(type))
      return typeToProcessor.get(type);
    else
      throw new GoldifyException("Unsupported format: "+type);
  }
View Full Code Here

    try {
      //long tm1 = Calendar.getInstance().getTimeInMillis();
      map = MapBuilder.fromXmlFile(config.getNameMapFilename());
      //System.err.format("Loading map took %d ms\n", (Calendar.getInstance().getTimeInMillis()-tm1));
    } catch (Exception e) {
      throw new GoldifyException(String.format("Could not load the terms from XML file '%s'\n", config.getNameMapFilename()));
    }
    TextMarker tm;
    try {
      tm = new TextMarker(map, config.getExcludedTerms());
    } catch (Exception e) {
      throw new GoldifyException(String.format("Could not load the list of excluded terms from XML file '%s'\n", config.getExcludedTermsFilename()));
    }
    UrlBuilder ub = config.createUrlBuilder();
    DocumentProcessorManager dpm = new DocumentProcessorManager();
    dpm.registerProcessor("txt", new PlainTextProcessor(tm,ub,config.getTxtLinkTemplate()));
    dpm.registerProcessor("html", new HtmlProcessor(tm,ub,config.getHtmlLinkTemplate(),config.getHtmlForbiddenTags()));
View Full Code Here

TOP

Related Classes of org.iupac.goldbook.goldify.bases.GoldifyException

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.