Example #1
0
 // does nothing
 public OrderedProperties(OrderedProperties props) {
   Enumeration k = props.keys();
   String key;
   // suck in all the properties
   while (k.hasMoreElements()) {
     key = (String) k.nextElement();
     put(key, props.getProperty(key));
   }
 }
Example #2
0
  public static void main(String[] args) {
    try {
      FileInputStream fis = new FileInputStream(args[0]);
      OrderedProperties p = new OrderedProperties();
      java.util.Properties props = new java.util.Properties();

      p.load(fis);
      fis.close();
      fis = new FileInputStream(args[0]);
      props.load(fis);

      p.store(System.out);
      System.out.println("-------");
      props.save(System.out, null);
    } catch (IOException e) {
      System.out.println(e);
    }
  }