This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with ArrayList  RSS feed

 
Nader Harb
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I dont know if this is the right place to ask this question, but if you can help me out with this i would be grateful...

I was trying to read from an xml file and save node contents into an ArrayList, these contents are names of files which i need to use later after ..

the problem is: whenever i try this code to save the data i get always an error that the file is not found .. when i insert the name of the file using the .add("filename") it works perfectly.. so i thought it might be added spaces or something else ..

i wrote this to go through the child nodes of <archivefiles> and save the contents in an archivelist ..

thank you in advance

p.s. the "whole" variable is a Document variable that i stored the XML contents into Using DocumentBuilderFactory

Thank you in advance
Nader
 
Kevin Workman
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you see what you're passing in to the File constructor when it doesn't work?

By the way, code should be in the form of an SSCCE, and you should always use the code tags.
 
Nader Harb
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes:

Creating Lemmas... C:\Users\Nader\.java\LexMeter\data\
20090225045244

Oct 25, 2010 4:10:55 PM parsing.WordCount Count
SEVERE: null
java.io.FileNotFoundException: C:\Users\Nader\.java\LexMeter\data\
20090225045244
(The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
Errore: Could not create Lemmas:
java.io.FileNotFoundException: C:\Users\Nader\.java\LexMeter\data\
20090225045244
(The filename, directory name, or volume label syntax is incorrect)


in the xml file i only put the filename which is "0090225045244"
and i add the rest of the path with the .getProperty();
 
Nader Harb
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK ... i used another approach and i solved the problem .. thank you very much anyway
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!