The following code is giving me this error:
java.lang.NullPointerException
java.io.FileOutputStream.(Unknown Source)
java.io.FileOutputStream.(Unknown Source)
java.io.FileWriter.(Unknown Source)
SAXBuilder parser = new SAXBuilder();
this.document = parser.build(path);
//changes on the doc happening here
FileWriter writer = new FileWriter(path);
XMLOutputter out = new XMLOutputter();
out.output(this.document, writer);
writer.flush();
writer.close();
How come? It the file locked or something?
On a sidenote: What is the advantage of using BufferedOutputStream classes?
The issue was a wrong path to the file, like suggested.