Package org.apache.commons.configuration

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


                    //can be very time consuming & we do not want this delay each time we want to see workflow statistics
                    String solrConfigDir = configurationService.getProperty("dspace.dir") + File.separator + "config"
                            + File.separator + "modules" + File.separator + "usage-statistics.cfg";
                    PropertiesConfiguration config = new PropertiesConfiguration(solrConfigDir);
                    config.setProperty("workflow-start-date", new DCDate(oldestDate));
                    config.save();
                } catch (ConfigurationException e) {
                    log.error("Error while storing workflow start date", e);
                }
                //ALso store it in our local config !
                configurationService.setProperty("usage-statistics.workflow-start-date", new DCDate(oldestDate).toString());
View Full Code Here


  @Override
  public synchronized String currentConfig() {
    PropertiesConfiguration saver = new PropertiesConfiguration();
    StringWriter writer = new StringWriter();
    saver.copy(config);
    try { saver.save(writer); }
    catch (Exception e) {
      throw new MetricsConfigException("Error stringify config", e);
    }
    return writer.toString();
  }
View Full Code Here

   * @throws ConfigurationException
   */
  public static void setTargetUrl(String targetUrl) throws ConfigurationException {
    PropertiesConfiguration config = new PropertiesConfiguration(adminPropertyFileName);
    config.setProperty("targetUrl", targetUrl);
    config.save();
  }

  /**
   * get Spring Hadoop Admin service URL
   * @return service URL
View Full Code Here

   * @throws ConfigurationException
   */
  public static void setDfsName(String dfsName) throws ConfigurationException {
    PropertiesConfiguration config = new PropertiesConfiguration(adminPropertyFileName);
    config.setProperty("dfs.default.name", dfsName);
    config.save();
  }

  /**
   * get HDFS URL
   * @return HDFS URL
View Full Code Here

     */
    private void updateDefaultVersion(String key) throws CommandExecutionException {
        final PropertiesConfiguration properties = globalConfig.getProperties();
        properties.setProperty(mapping.get(type).getName(), key);
        try {
            properties.save();
            SignatureFileInfo sigFileInfo = signatureManager.getDefaultSignatures().get(type);
            printWriter.println(I18N.getResource(I18N.CONFIGURE_SIGNATURE_FILE_VERSION_SUCCESS,
                    sigFileInfo.getVersion(), sigFileInfo.getFile().getName()));
                   
        } catch (ConfigurationException e) {
View Full Code Here

                + workLoadList[0]);
        workLoadConfig.setProperty("readproportion", "1");
        workLoadConfig.setProperty("updateproportion", "0");
        workLoadConfig.setProperty("scanproportion", "0");
        workLoadConfig.setProperty("insertproportion", "0");
        workLoadConfig.save();

        config.setProperty("workload.file", workLoadList[0]);
        config.save();
        process();
View Full Code Here

            PropertiesConfiguration workLoadConfig = new PropertiesConfiguration(workLoadPackage + "/" + workLoad);
            workLoadConfig.setProperty("readproportion", "0");
            workLoadConfig.setProperty("updateproportion", "1");
            workLoadConfig.setProperty("scanproportion", "0");
            workLoadConfig.setProperty("insertproportion", "0");
            workLoadConfig.save();
            process();
        }

    }
View Full Code Here

       config.setProperty("db.simulator.port", "" + port);
       config.setProperty("db.simulator.username", System.getProperty("user.name"));
       config.setProperty("db.simulator.password", "");

       config.save();
    }
   
    public static void initCloudstackDb() throws Exception {
        try {
            File dir = new File("../../../");
View Full Code Here

                        } else {
                            config.setProperty("user.uid", "");
                            config.setProperty("user.pwd", "");
                            config.setProperty("login.dialog", "true");
                        }
                        config.save();
                    } catch (ConfigurationException e) {
                        LOGGER.error("can't save properties", e);
                    }
                } catch (PTException e) {
                    LOGGER.error("Can't log in!", e);
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.