Java Reference
In-Depth Information
String shouldWakeUpProperty
= properties.getProperty("ShouldWakeup");
shouldWakeUp = (shouldWakeUpProperty == null) ? false
Boolean.parseBoolean(shouldWakeUpProperty.trim().toLowerCase());
String startCounterProperty
= properties.getProperty("StartCounter");
try {
startCounter = Integer.parseInt(startCounterProperty);
} catch (Exception e) {
System.out.println("Couldn't read startCounter,
defaulting to "+startCounter);
}
String dateFormatStringProperty
= properties.getProperty("DateFormatString",
"MMM dd yy");
System.out.println("Should Wake up? "+shouldWakeUp);
System.out.println("Start Counter: "+startCounter);
System.out.println("Date Format
String:"+dateFormatStringProperty);
//setting property
properties.setProperty("StartCounter","250");
try {
properties.store(new
FileOutputStream("properties.conf"),"Properties
Description");
} catch (IOException e) {
e.printStackTrace();
}
properties.list(System.out);
How It Works
Search WWH ::




Custom Search