How to read directories from a deployed .EAR file?

C

Collin VanDyck

I've got an application deployed as a .EAR file, and part of the
startup process is to iterate through a number of updates that bring
old databases up to speed with the current codebase.

To date we've deployed the application as a flat, exploded file &
directory hierarchy, which allowed me to simply use a java.io.File to
locate the update directory and from there recurse through the
subdirectories and files to find all of the updates.

However, with this single .EAR I am having trouble trying to figure out
how to get access to the directory. I can access single, known files
in the archive using Class.getResourceAsStream(path) without any
problem.

What is the equivalent for reading packed directories? Is this even
possible, and if not, would I need to create a definitive list of these
files as part of the build process and then getResourceAsStream() for
the list that I created before, parse that, and then
getResourceAsStream() for each file in the list?

Also, I tried to search for this, but Google Groups kept telling me
that none of my search results were available. :(

thanks for any help!

Collin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top