LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-02-2005, 12:18 AM   #1
Laser Devil
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Rep: Reputation: 0
Unhappy 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
 
Old 06-02-2005, 07:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
this has nothing to do with the feedback or suggestions for this website. please choose your forum more carefully before posting.
 
Old 06-02-2005, 10:36 AM   #3
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 10,425

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

--jeremy
 
Old 06-05-2005, 07:51 PM   #4
Laser Devil
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Original Poster
Rep: Reputation: 0
To acid_kewpie.
I am new to this. How should I address my problem?

Anyone? Help!!!
 
Old 06-06-2005, 01:18 AM   #5
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Rep: Reputation: 30
try using the "URL" class instead of "File". check it out on the java API reference.
 
Old 06-11-2005, 12:51 AM   #6
Laser Devil
LQ Newbie
 
Registered: Mar 2005
Posts: 3

Original Poster
Rep: Reputation: 0
URL class is not the right class. I checked it out. Thanks for helping. I am still lost. HELP!!!

Last edited by Laser Devil; 06-11-2005 at 12:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Login screen with list of names BaltikaTroika Suse/Novell 3 11-18-2005 10:53 PM
Spaces in folder/file names ~ termial Garoth Linux - Software 1 11-12-2004 01:56 PM
folder names difference in KDE and the command line twallstr Linux - Newbie 2 10-04-2004 01:26 PM
long folder names opsraja Fedora 2 09-23-2004 01:56 PM
how to ban certain file or folder names Goma_2 Linux - General 0 06-03-2004 03:54 AM


All times are GMT -5. The time now is 06:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration