Slick Forums

Discuss the Slick 2D Library
It is currently Fri May 24, 2013 6:27 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Apr 07, 2009 7:22 pm 
Offline
User avatar

Joined: Fri Dec 28, 2007 3:37 pm
Posts: 87
Location: bremen, germany
I need a method to get all files in a folder. So instead of using getResource for single file I want to use getResources to get a collection (or an Enumeration) of all files in a given folder.

here's a patch, works for me, may contain bugs

hf
kulpae

edit: I haven't tested the implementation of getResources() within ClasspathLocation, but I think this should work...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 8:30 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
The version for Classpath doesn't work, getResources() there finds any resources of that name in any of the classpath sources, rather than finding all the elements within a directory.

I don't think it's a possible with classpaths, but let me check first.

EDIT: No, it's not as far as I can tell. I thought you might be able to open the directory path as a resource and read a list of the contents but that only works for some sorts of resources.

Don't think this one is possible I'm afraid.

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 07, 2009 9:29 pm 
Offline
User avatar

Joined: Fri Dec 28, 2007 3:37 pm
Posts: 87
Location: bremen, germany
what a pity, but it's okay... I can write an utils class that offer this scan method, that would work as well ;)
But then it will produce troubles when running through webstart. hmm... I'll setup an config file with all files to load from my directory... yeah, thats a good idea...

thank you anyway,
cheers kulpae


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 17, 2009 5:27 pm 
Offline
Regular
User avatar

Joined: Wed Apr 15, 2009 12:51 pm
Posts: 104
I also need a implementation of this feature! ;)

I've about 900 images in my game which change frequently. It's realy hard to add/remove/adjust 900 pathes in my game!

Maybe now after two years of thinking about that you will find a way to implement this! :)

Would be great!
Thank you very much for this great framework!

Lufti


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group