AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Newbie: How to read HTTP directory

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
ProfTheory
Guest





PostPosted: Mon Dec 29, 2003 3:20 am    Post subject: Newbie: How to read HTTP directory Reply with quote



Hello,
I want to be able to determine if a given file is on an say
'crcap010104.gif' is available and if it is to download it (if not skip it).

Where is a good source of information such as this? website or book.

n20hh
yahoo

Vin

Back to top
Andrew Thompson
Guest





PostPosted: Mon Dec 29, 2003 10:11 am    Post subject: Re: Newbie: How to read HTTP directory Reply with quote



"ProfTheory" <spam (AT) inter (DOT) net> wrote

Quote:
Hello,
I want to be able to determine if a given file is on an say
'crcap010104.gif' is available and if it is to download it (if not skip
it).


If you always know the name and path
of the resource, there are a number of
ways to tell if it is there, probably by
using the same methods you use to get
them.

Methods to get a resource will generally
throw an exeption if the resource is missing.

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site



Back to top
Tor Iver Wilhelmsen
Guest





PostPosted: Mon Dec 29, 2003 10:25 am    Post subject: Re: Newbie: How to read HTTP directory Reply with quote



ProfTheory <spam (AT) inter (DOT) net> writes:

Quote:
I want to be able to determine if a given file is on an say
'crcap010104.gif' is available and if it is to download it (if not
skip it).

Use java.net.HttpURLConnection and test the status code; you get 2xx
or 3xx if it's avaliable, if you set it to automatically redirect it
will hide 3xx reponses from you.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.