07.01.2013 Views

David Defour - Université de Perpignan

David Defour - Université de Perpignan

David Defour - Université de Perpignan

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

URL Searcher<br />

• I<strong>de</strong>a<br />

–Print out all lines in a given URL that contain keyword<br />

• Approach<br />

618<br />

jeudi 26 janvier 12<br />

–Read URL and keyword from user<br />

–Call theUrl.openConnection and cast result to<br />

HttpURLConnection<br />

–Attach BufferedRea<strong>de</strong>r to the HttpURLConnection<br />

–Read one line at a time (until null), checking if the line<br />

contains the keyword<br />

–Catch MalformedURLException and IOException<br />

–Call disconnect() when done

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!