Saving data in an XML file
I've been trying to create an XML file using Java to do it.
It would be used to save data for various things.
However, it seems to crash when it tries to create a new file.
I gave it the following location to which it should save the file:
String location = getClass().getResource("/core/data/maps/custom/") + "mapname.xml";
The location itself is correct and the folders exist.
However when I try to create the file with:
FileOutputStream theFile = new FileOutputStream(location);
Using the above doesn't work, any idea what I'm doing wrong?
The remainder of the class is nothing but printing a few lines of text in the file, flushing and closing the file and they don't cause the problem.