How to enumerate resources?

Discussion in 'Java' started by Rene Ruppert, Jul 7, 2004.

  1. Rene Ruppert

    Rene Ruppert Guest

    Hi,

    I'm trying to get an enumeration of all "files" from my resources.
    I tried getResources("resource/media/gifs/*") and similar constructions -
    without success.
    Is there a way to get a listing of all resources in a special package?

    Thanks.

    cu

    Rene
    Rene Ruppert, Jul 7, 2004
    #1
    1. Advertising

  2. On Wed, 7 Jul 2004 11:41:39 +0200, Rene Ruppert wrote:

    > Is there a way to get a listing of all resources in a special package?


    No.

    Though there are particular situations where
    it is possible to find out what resources exist...

    'At this moment' in a file system 'package'
    (directory) using File.listFiles().

    OTOH resources soming from Zip/Jar can be
    determined from the enumeration of ZipEntries.

    Since it is such a rare occurrence though, it
    begs the question. Why do you think you need
    to do this?

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jul 7, 2004
    #2
    1. Advertising

  3. Rene Ruppert

    Roedy Green Guest

    On Wed, 07 Jul 2004 10:42:57 GMT, Andrew Thompson
    <> wrote or quoted :

    >Since it is such a rare occurrence though, it
    >begs the question. Why do you think you need
    >to do this?


    Normally what you do is create the list as a property file or
    serialised collection and include it in the jar.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 7, 2004
    #3
    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. poi

    Enumerate Roles?

    poi, Nov 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    489
    Oliver
    Nov 15, 2003
  2. shiv
    Replies:
    3
    Views:
    6,770
    S. Justin Gengo
    Dec 3, 2003
  3. localhost

    Enumerate Control Attributes?

    localhost, Dec 16, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    600
    localhost
    Dec 22, 2003
  4. Arsen Vladimirskiy

    How to enumerate sessions?

    Arsen Vladimirskiy, Jan 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,399
    David Browne
    Jan 9, 2004
  5. Russell E. Owen
    Replies:
    0
    Views:
    693
    Russell E. Owen
    Sep 8, 2006
Loading...

Share This Page