from the 3zlCAP projekt
short example to create XML configuration file:


public class Cap {

String version="1.007d",
subvers="subv",
hostURL="http://192.168.0.1", // trizonia
port="8082",
fileXferDoc="/",
hsUsersDoc="/",
adminUserName="admin",
adminPassw="PPPPP",
operatorName="AnyName",
operatorPassw="yourpassword",
logFileName="caplog.txt"; // full path ?


public String getVersion(){
return(version+"."+subvers);
}
public String gethostURL(){
return (hostURL);
}
public void sethostURL(String url){
hostURL=url;
}



public void setXML(){
String testString="TEST";

XMLConfiguration xml_config = new XMLConfiguration();
xml_config.setRootElementName("Cap");
xml_config.setProperty("Class", this.getClass().getName());
xml_config.setProperty("logFileName", testString);
xml_config.setProperty("version", getVersion());
xml_config.setProperty("hostURL", gethostURL());

try {
String file_name="cap.XML";
xml_config.save(new File(file_name));
} catch (ConfigurationException ex) {
Logger.getLogger(Cap.class.getName()).log(Level.SEVERE, null, ex);
}
/*
* this creates the file "cap.XML" holding following

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

desktopapplication2.Cap
TEST
1.007d.subv
http://192.168.1.11


*/
}

}


*fin