How to enumerate resources?

R

Rene Ruppert

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
 
A

Andrew Thompson

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?
 
R

Roedy Green

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.
 

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

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top