| View previous topic :: View next topic |
| Author |
Message |
ProfTheory Guest
|
Posted: Mon Dec 29, 2003 3:20 am Post subject: Newbie: How to read HTTP directory |
|
|
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
|
Posted: Mon Dec 29, 2003 10:11 am Post subject: Re: Newbie: How to read HTTP directory |
|
|
"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
|
Posted: Mon Dec 29, 2003 10:25 am Post subject: Re: Newbie: How to read HTTP directory |
|
|
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 |
|
 |
|