• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dead Hyperlinks - How do you check for them in advance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dead Hyperlinks - How do you check for them in advance


  • Subject: Re: Dead Hyperlinks - How do you check for them in advance
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Thu, 29 Jul 2004 14:31:40 +0100

Thanks Patrick,
That's just the sort of thing I was looking for.

Jonathan :^)


From: Patrick Robinson <email@hidden>
To: Jonathan Fleming <email@hidden>
CC: email@hidden
Subject: Re: Dead Hyperlinks - How do you check for them in advance
Date: Thu, 29 Jul 2004 08:48:56 -0400

On Jul 29, 2004, at 8:10 AM, Jonathan Fleming wrote:
How does one check in advance for dead links so that a WOHyperlink can be turned off if this proves to be true?

Here is some code I've used (HttpURLConnection is in java.net):

public static boolean isValid(String url) {
try {
HttpURLConnection c = (HttpURLConnection)new URL(url).openConnection();
c.setRequestMethod("HEAD");
return (c.getResponseCode() == HttpURLConnection.HTTP_OK);
} catch (IOException e) {
return false;
}
}


--
Patrick Robinson
AHNR Info Technology, Virginia Tech
email@hidden


_________________________________________________________________ Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo _______________________________________________ webobjects-dev mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev Do not post admin requests to the list. They will be ignored.


  • Prev by Date: directaction new session created
  • Next by Date: RE: directaction new session created
  • Previous by thread: Re: Dead Hyperlinks - How do you check for them in advance
  • Next by thread: Problem with file upload
  • Index(es):
    • Date
    • Thread