How can you get a list (names) of pictures from a web folder?
Help!!
I am working on an applet that will automatically load in pictures from specific folder from the web server. For example:www-mysite-com/gallery/photo_5/[/url] The folder called "photo_5" will contain jpg images that I would like to get a list of. I was able to use the "File" class to do this. The code to receive the list of images located in a folder is shown below. //Get the image names. public void imageNames() { //FilenameFilter filter = new FilenameFilter(); File imageNames = new File(info.imageLocation()); String stringNames = null; String names[] = imageNames.list(); for(int i = 0; i <= names.length- 2; i++) stringNames = stringNames + "\n" + names[i]; message("File Names",stringNames); } Here is the problem: If "info.imageLocation()" returns "www-mysite-com/gallery/photo_5/" It does not work. However, if "info.imageLocation()" returns a location that is local such as "D:/gallery/photo_5/" it works. I am not sure if I am using the right class to do this. Maybe the File class is the wrong one because I looked at the methods of the File class, it seems the constructor parameter takes in a string, not a URL. Is it even possible to get a list of images that is located in specific location? Any help would be useful. Thank you, -Mainul You can e-mail me at laser_devil@hotmail.com |
this has nothing to do with the feedback or suggestions for this website. please choose your forum more carefully before posting.
|
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
--jeremy |
To acid_kewpie.
I am new to this. How should I address my problem? Anyone? Help!!! |
try using the "URL" class instead of "File". check it out on the java API reference.
|
URL class is not the right class. I checked it out. Thanks for helping. I am still lost. HELP!!!
|
All times are GMT -5. The time now is 09:30 AM. |