This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listing files embedded in an EAR

 
vince walker
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have XML files which I want to store in an EAR. When the app starts, I want to read all the XML files and load them into memory. I found getClass().getResourceAsStream(...) to load a file if I know the name. But how can I list all the files and iterate through them if I don't know the names in advance?
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store a text file along with the XML files which contains a list of the names of the XML files.
 
Balaji Manoharan Bm
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give the directory name as input to getResourceAsStream() and the use File.listFiles() method to know all the files available in that directory.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic