My URL Java Application
1 posts in topic
Flat View  Flat View

Posted By:   Ashley_Tate
Posted On:   Monday, April 16, 2001 10:20 AM

I was wondering if anyone can help me work out how to go about writing a java application that checks for broken URL links and add full URLS into a vector. I need to do this by Thursday, April 19 at midnight. Please get back to me A.S.A.P.!!

Re: My URL Java Application

Posted By:   Michael_Wax  
Posted On:   Monday, April 16, 2001 03:43 PM

What you need to do is to create a URL object for each URL, and then either create and read from a URLConnection for each, or just get an InputStream from the URL. If you are unable to get an InputStream, or if you cannot read anything from the stream, or if what yo are reading specifies a 404 (Found) or 500 (Internal Server) eror, then you have a broken link. You can then add the URL (either the object or the string) to the vector.
About | Sitemap | Contact