Package de.fuberlin.wiwiss.pubby

Examples of de.fuberlin.wiwiss.pubby.ConfigurationException


  public void contextInitialized(ServletContextEvent sce) {
    ServletContext context = sce.getServletContext();
    try {
      String configFileName = context.getInitParameter("config-file");
      if (configFileName == null) {
        throw new ConfigurationException("Missing context parameter \"config-file\" in /WEB-INF/web.xml");
      }
      File configFile = new File(configFileName);
      if (!configFile.isAbsolute()) {
        configFile = new File(context.getRealPath("/") + "/WEB-INF/" + configFileName);
      }
      String url = configFile.getAbsoluteFile().toURI().toString();
      try {
        Model m = FileManager.get().loadModel(url);
        Configuration conf = Configuration.create(m);
        context.setAttribute(SERVER_CONFIGURATION, conf);
      } catch (JenaException ex) {
        throw new ConfigurationException(
            "Error parsing configuration file <" + url + ">: " +
            ex.getMessage());
      }
    } catch (ConfigurationException ex) {
      log(ex, context);
View Full Code Here


  }
 
  private String[] parseQueryParam(String param) {
    Matcher match = queryParamPattern.matcher(param);
    if (!match.matches()) {
      throw new ConfigurationException("Query parameter \"" + param +
          "\" is not in \"param=value\" form");
    }
    return new String[]{match.group(1), match.group(2)};
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.pubby.ConfigurationException

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.