Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.XMLConfiguration.load()


      x.write(el);
    } catch (IOException e) {
    }
    XMLConfiguration xmlConfig = new XMLConfiguration();
    try {
      xmlConfig.load(new StringReader(w.toString()));
    } catch (ConfigurationException e) {
      throw new JibeRuntimeException(e);
    }
    xmlConfig.setExpressionEngine(new XPathExpressionEngine());
    cc.setConfiguration(xmlConfig);
View Full Code Here


      else{
        logger.warn("cannot find schema-xsd file (vrp_xml_schema.xsd). try to read xml without xml-file-validation.");
      }   
    }
    try {
      xmlConfig.load();
    } catch (ConfigurationException e) {
      logger.error(e);
      e.printStackTrace();
      System.exit(1);
    }
View Full Code Here

    protected HierarchicalConfiguration parseXML(InputStream xml, boolean validate)
            throws ConfigurationException {
        try {
            XMLConfiguration config = new XMLConfiguration();
            config.setValidating(validate);
            config.load(xml);
            return config;
        } catch (Exception e) {
            throw new ConfigurationException(
                    "Configuration file could not be read.", e);
        }
View Full Code Here

                } else {
                    try {
                       
                        XMLConfiguration config = new XMLConfiguration(FILE_CONFIG);
                        config.setAutoSave(false);
                        config.load();

                        long ver = config.getLong("version");
                        if (VERSION_TAG > ver) {
                            // overwrite previous configuration file
                            copier.copy(new File(FILE_CONFIG_DEFAULT),f);                       
View Full Code Here

        } else {
          try {

            XMLConfiguration config = new XMLConfiguration(FILE_CONFIG);
            config.setAutoSave(false);
            config.load();

            long ver = config.getLong("version");
            if (VERSION_TAG > ver) {
              // overwrite previous configuration file
              copier.copy(new File(FILE_CONFIG_DEFAULT), f);
View Full Code Here

    private XMLConfiguration getConfig(Resource r) throws ConfigurationException, IOException {
        XMLConfiguration config = new XMLConfiguration();
        config.setDelimiterParsingDisabled(true);
       
        // Use InputStream so we are not bound to File implementations of the config
        config.load(r.getInputStream());
        return config;
    }

    public void setConfigurationMappings(Map<String,String> resources) {
        this.resources = resources;
View Full Code Here

        if (isConfigured) {
            final String rexsterXmlFile = servletConfig.getInitParameter("com.tinkerpop.rexster.config");
            final XMLConfiguration properties = new XMLConfiguration();

            try {
                properties.load(new FileReader(rexsterXmlFile));
            } catch (Exception e) {
                throw new RuntimeException("Could not locate " + rexsterXmlFile + " properties file.", e);
            }

            configure(properties);
View Full Code Here

    public void setUp() throws Exception {
        clean();

        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(Application.class.getResourceAsStream("rexster-integration-test.xml"));
        rexsterServer = new HttpRexsterServer(properties);

        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
        final RexsterApplication application = new XmlRexsterApplication(graphConfigs);
        rexsterServer.start(application);
View Full Code Here

    }

    @BeforeClass
    public static void setUp() throws Exception {
        final XMLConfiguration properties = new XMLConfiguration();
        properties.load(AbstractRexsterPerformanceTest.class.getResourceAsStream("rexster-performance-test.xml"));
        rexProServer = new RexProRexsterServer(properties);
        httpServer = new HttpRexsterServer(properties);

        final List<HierarchicalConfiguration> graphConfigs = properties.configurationsAt(Tokens.REXSTER_GRAPH_PATH);
        final RexsterApplication application = new XmlRexsterApplication(graphConfigs);
View Full Code Here

        String xmlString = "<extension><namespace>tp</namespace><name>extensionname</name><configuration><test>1</test></configuration></extension>";

        XMLConfiguration xmlConfig = new XMLConfiguration();

        try {
            xmlConfig.load(new StringReader(xmlString));
        } catch (ConfigurationException ex) {
            Assert.fail(ex.getMessage());
        }

        List<HierarchicalConfiguration> list = new ArrayList<HierarchicalConfiguration>();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.