I am working on an applet that will automatically load in pictures from specific folder from the web server.
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];
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.
You can e-mail me at email@example.com