Skip to content

Instantly share code, notes, and snippets.

@khannedy
Created April 1, 2013 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khannedy/5285634 to your computer and use it in GitHub Desktop.
Save khannedy/5285634 to your computer and use it in GitHub Desktop.
AppPropConfig
package eecchhoo.commons.config;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import java.io.File;
/**
* @author Eko Kurniawan Khannedy
*/
public class AppPropConfig {
static public void main(String[] args) throws ConfigurationException {
// membuat objek konfigurasi
PropertiesConfiguration configuration = new PropertiesConfiguration();
// menambah konfigurasi
configuration.addProperty("app.width", 800);
configuration.addProperty("app.height", 640);
configuration.addProperty("app.title", "App Bla Bla Bla");
configuration.addProperty("app.fullscreen", false);
// menyimpan konfigurasi
File file = new File("/Users/khannedy/Desktop/setting.properties");
configuration.save(file);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment