/** sometimes call by sample application, at that time normally set some properties directly */ private Configure() { Properties p = new Properties(); Map args = new HashMap(); args.putAll(System.getenv()); args.putAll(System.getProperties()); p.putAll(args); this.property = p; reload(false); }
public void writeProperties(Map<?, ?> properties) { Properties props = new Properties(); props.putAll(properties); try { FileOutputStream stream = new FileOutputStream(this); try { props.store(stream, "comment"); } finally { stream.close(); } } catch (IOException e) { throw new RuntimeException(e); } }