Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-08-2007, 09:34 PM
Member
 
Join Date: Dec 2007
Posts: 13
Thez is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-08-2007, 10:24 PM
Member
 
Join Date: Dec 2007
Posts: 13
Thez is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving data...? easyRyder New To Java 8 07-15-2008 04:14 AM
Regarding Tabular data from .doc file praveen83 Advanced Java 8 04-03-2008 09:00 AM
Saving objects to file JavaForums Java Blogs 3 02-02-2008 06:48 PM
Accessing Data from a .txt file Oasis13 New To Java 5 02-01-2008 01:16 AM
Reading Data from a file ramachandran New To Java 2 10-24-2007 08:22 AM


All times are GMT +3. The time now is 06:19 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org