I am writing a program to store stuff to xml using the storeToXML method
but I can;t get it to compile here it is; any ideas?
import java.io.*;
import java.util.*;
public class XmlWrite {
public static void main(String args[]) throws Exception {
try {
Properties props = new Properties();
props.setProper ty("something" , "bla");
props.setProper ty("stuff", "brown and black");
props.setProper ty("morestuff" , "me");
props.setProper ty("enablepassw ord", "yes");
props.setProper ty("answer", "null");
String OperatingSystem = System.getPrope rty("user.home" ) +"\\";
FileOutputStrea m xmlwrite =
new FileOutputStrea m(OperatingSyst em + "config.xml ");
props.java.util .Properties.sto reToXML(xmlwrit e, "config");
xmlwrite.close( );
}
// if writing to the specified output stream results in an
IOException
catch (IOException e) {
//Print system error
System.err.prin tln("An Error Occured While Writing To The
File");
}
// if os is null.
catch (NullPointerExc eption e) {
//Print system error
System.err.prin tln("OS Value is Null");
}
}
}