anl.aida.reader
Class ReaderUtilities

java.lang.Object
  extended by anl.aida.reader.ReaderUtilities

public class ReaderUtilities
extends java.lang.Object

Reader related utility methods.


Constructor Summary
ReaderUtilities()
           
 
Method Summary
static java.lang.String getHTMLAsString(java.net.URL url)
          Gets the contents of the url as a String.
static java.net.URL getRedirectedURL(java.lang.String urlString)
          Tests the specified URL for redirection and if its been redirected then follows the redirect until it finds a non 301 URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReaderUtilities

public ReaderUtilities()
Method Detail

getHTMLAsString

public static java.lang.String getHTMLAsString(java.net.URL url)
                                        throws java.io.IOException
Gets the contents of the url as a String. Assumes the charset is ISO-8859-1.

Parameters:
url - the url whose content we get
Returns:
the contents of the url as a string
Throws:
java.io.IOException - if there is an error getting the url content

getRedirectedURL

public static java.net.URL getRedirectedURL(java.lang.String urlString)
                                     throws java.io.IOException
Tests the specified URL for redirection and if its been redirected then follows the redirect until it finds a non 301 URL.

Parameters:
urlString -
Returns:
Throws:
java.io.IOException