• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with ArrayList

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK ... i used another approach and i solved the problem .. thank you very much anyway
 
reply
    Bookmark Topic Watch Topic
  • New Topic