Results 1 to 2 of 2
  1. #1
    Thez is offline Member
    Join Date
    Dec 2007
    Posts
    13
    Rep Power
    0

    Default 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.

  2. #2
    Thez is offline Member
    Join Date
    Dec 2007
    Posts
    13
    Rep Power
    0

    Default

    Nvm, I got it already, it was NetBeans that didn't compile folder structure like it is in the src folders/packages it creates.

    I found a way for Java to create the folders so it should be fine.

Similar Threads

  1. Regarding Tabular data from .doc file
    By praveen83 in forum Advanced Java
    Replies: 10
    Last Post: 03-23-2010, 12:26 PM
  2. Saving data...?
    By easyRyder in forum New To Java
    Replies: 8
    Last Post: 07-15-2008, 04:14 AM
  3. Accessing Data from a .txt file
    By Oasis13 in forum New To Java
    Replies: 5
    Last Post: 02-01-2008, 01:16 AM
  4. Reading Data from a file
    By ramachandran in forum New To Java
    Replies: 2
    Last Post: 10-24-2007, 08:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •