Package org.apache.commons.configuration

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


  private void load()
  {
    try
    {
      PropertiesConfiguration pc = new PropertiesConfiguration();
      pc.load("bgslibrary_gui.properties");
     
      basePath = pc.getString("base.path");
      configPath = basePath + pc.getString("config.path");
     
      String paths[] = pc.getStringArray("run.path");
View Full Code Here


     */
    public void testFromClassPath() throws Exception
    {
        PropertiesConfiguration config = new PropertiesConfiguration();
        config.setFileName(TEST_FILE);
        config.load();
        assertTrue(config.getBoolean("configuration.loaded"));
        FileChangedReloadingStrategy strategy = new FileChangedReloadingStrategy();
        config.setReloadingStrategy(strategy);
        assertEquals(config.getURL(), strategy.getFile().toURL());
    }
View Full Code Here

    }

    private PropertiesConfiguration loadConfig() throws org.apache.commons.configuration.ConfigurationException,
            IOException {
        PropertiesConfiguration config = new PropertiesConfiguration();
        config.load(Resources.getResource("default.s4.core.properties").openStream());
        return config;
    }

    @Test
    public void testInitialDeploymentFromFileSystem() throws Exception {
View Full Code Here

            this.shell.getInterp().getContext().setProperty("g", this.giraphGraph);
        }
        if (args.size() == 1) {
            try {
                final FileConfiguration configuration = new PropertiesConfiguration();
                configuration.load(new File(args.get(0)));
                this.giraphGraph = GiraphGraph.open(configuration);
                this.shell.getInterp().getContext().setProperty("g", this.giraphGraph);
            } catch (final Exception e) {
                throw new RuntimeException(e.getMessage(), e);
            }
View Full Code Here

                throw new RuntimeException(e.getMessage(), e);
            }
        } else if (args.size() == 2) {
            try {
                final FileConfiguration configuration = new PropertiesConfiguration();
                configuration.load(new File(args.get(0)));
                this.giraphGraph = GiraphGraph.open(configuration);
                this.graphVariable = args.get(1);
                this.shell.getInterp().getContext().setProperty(args.get(1), this.giraphGraph);
            } catch (final Exception e) {
                throw new RuntimeException(e.getMessage(), e);
View Full Code Here

  }

  public static ClientConfiguration deserialize(String serializedConfig) {
    PropertiesConfiguration propConfig = new PropertiesConfiguration();
    try {
      propConfig.load(new StringReader(serializedConfig));
    } catch (ConfigurationException e) {
      throw new IllegalArgumentException("Error deserializing client configuration: " + serializedConfig, e);
    }
    return new ClientConfiguration(propConfig);
  }
View Full Code Here

    // load the required base props
    try {
      props = new PropertiesConfiguration();
      props.setDelimiterParsingDisabled(disableDelimeterParsing);
      props.load(url);
    }
    catch(ConfigurationException ce) {
      throw new RuntimeException("Unable to load properties '" + url + "': " + ce.getMessage(), ce);
    }
View Full Code Here

    // load the required base props
    try {
      props = new PropertiesConfiguration();
      props.setDelimiterParsingDisabled(disableDelimeterParsing);
      props.load(url);
    }
    catch(ConfigurationException ce) {
      throw new RuntimeException("Unable to load properties '" + url + "': " + ce.getMessage(), ce);
    }
View Full Code Here

    {
        jndiDS = new JetspeedTestJNDIComponent();
        jndiDS.setup();

        PropertiesConfiguration config = new PropertiesConfiguration();
        config.load(new FileInputStream(PortalTestConstants.JETSPEED_PROPERTIES_PATH));
               
        String appRoot = PortalTestConstants.JETSPEED_APPLICATION_ROOT;
       
        MockServletConfig servletConfig = new MockServletConfig();       
        ResourceLocatingServletContext servletContent = new ResourceLocatingServletContext(new File(appRoot));       
View Full Code Here

    {
        String fileName = System.getProperty("org.apache.jetspeed.page.import.configuration", "import.properties");
        PropertiesConfiguration configuration = new PropertiesConfiguration();
        try
        {
            configuration.load(fileName);       
            String [] bootAssemblies = configuration.getStringArray("boot.assemblies");
            String [] assemblies = configuration.getStringArray("assemblies");
            ClassPathXmlApplicationContext ctx;           
           
            if (bootAssemblies != null)
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.