Package de.xanders.common.exception

Examples of de.xanders.common.exception.ConfigException


  public Document getDocumentFromFile() {
      try {
        SAXBuilder builder = new SAXBuilder();
        document = builder.build(this.getClass().getResourceAsStream("/xandersone-config.xml"))
      } catch (IOException e) {
        throw new ConfigException("XmlConfigReader not properly initialized - ConfigurationException: " + e);
      } catch (JDOMException e) {
        throw new ConfigException("XmlConfigReader not properly initialized - ConfigurationException: " + e);
      }
      return document;
  }
View Full Code Here


    if (document == null) {
      document = getDocumentFromFile();
    }
        String property = (String) document.getProperty(key);
    if (property == null) {
      throw new ConfigException("Property not found, key =" + key);
    }
        return property;
    }
View Full Code Here

     * @param key
     * @param value
     */
    public void saveProperty(Object key, Object value) {
    if (document == null) {
      throw new ConfigException("XmlConfigReader not properly initialized");
    }
        document.setProperty((String) key, (String) value);
    }
View Full Code Here

    /**
     * @see ConfigReader#getStringProperty(String)
     */
    public String getStringProperty(String key) {
      throw new ConfigException("getStringProperty(String key) is not supported.");
    }
View Full Code Here

  /**
   * @see com.ing.diba.common.config.ConfigReader#getProperties()
   */
  public Properties getProperties() {
    throw new ConfigException("getProperties() is not supported.");
  }
View Full Code Here

TOP

Related Classes of de.xanders.common.exception.ConfigException

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.