How to read directories from a deployed .EAR file?

Discussion in 'Java' started by Collin VanDyck, Mar 31, 2005.

  1. 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
    Collin VanDyck, Mar 31, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. boku
    Replies:
    4
    Views:
    12,142
    Boncho66
    Jun 1, 2009
  2. Greg Williams

    ear's war's and exploded directories

    Greg Williams, Jul 30, 2003, in forum: Java
    Replies:
    1
    Views:
    624
    Joe Pribele
    Aug 1, 2003
  3. Aaron

    Memory Leak with ear file??

    Aaron, Oct 16, 2003, in forum: Java
    Replies:
    4
    Views:
    481
    Michael Borgwardt
    Oct 17, 2003
  4. Rob Manger
    Replies:
    0
    Views:
    1,323
    Rob Manger
    Jul 21, 2004
  5. crash.test.dummy
    Replies:
    0
    Views:
    337
    crash.test.dummy
    Mar 16, 2007
Loading...

Share This Page