Package org.apache.commons.configuration

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


      {
        // interpolate the file so that no includes are required
        PropertiesConfiguration c2 = (PropertiesConfiguration) _fileConfiguration.interpolatedConfiguration();

        // save the file
        c2.save(cn);
      }
      return cn.getCanonicalPath();

    }
    catch (Exception ex)
View Full Code Here


       * it.hasNext(); ) { Monitor m = (Monitor) it.next();
       * System.out.println(m.getName()); System.out.println("> "+
       * m.getValue()); }
       */

      conf.save(output);
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
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

    }
    else {
      System.out.println("Data Migration failed. Reverting db.properties");
      //revert db.properties
      try {
        backupDBProps.save();
      } catch (ConfigurationException e) {
        e.printStackTrace();
      }
      if(encryptionType.equals("file")){
        //revert secret key in file
View Full Code Here

      }
      prop = dbProps.getProperty("db.usage.password");
      if(prop!=null && !prop.isEmpty()){
        newDBProps.setProperty("db.usage.password", "ENC("+msEncryptor.encrypt(prop)+")");
      }
      newDBProps.save(dbPropsFile.getAbsolutePath());
    } catch (Exception e) {    
      e.printStackTrace();
      return false;
    }
    System.out.println("Migrating db.properties Done.");
View Full Code Here

  public String serialize() {
    PropertiesConfiguration propConfig = new PropertiesConfiguration();
    propConfig.copy(this);
    StringWriter writer = new StringWriter();
    try {
      propConfig.save(writer);
    } catch (ConfigurationException e) {
      // this should never happen
      throw new IllegalStateException(e);
    }
    return writer.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

  @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

  @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

  @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

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.