LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How can you get a list (names) of pictures from a web folder? (https://www.linuxquestions.org/questions/programming-9/how-can-you-get-a-list-names-of-pictures-from-a-web-folder-329426/)

Laser Devil 06-02-2005 12:18 AM

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

acid_kewpie 06-02-2005 07:39 AM

this has nothing to do with the feedback or suggestions for this website. please choose your forum more carefully before posting.

jeremy 06-02-2005 10:36 AM

Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

--jeremy

Laser Devil 06-05-2005 07:51 PM

To acid_kewpie.
I am new to this. How should I address my problem?

Anyone? Help!!!

Ynot Irucrem 06-06-2005 01:18 AM

try using the "URL" class instead of "File". check it out on the java API reference.

Laser Devil 06-11-2005 12:51 AM

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.