Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.util
Class URLUtil

java.lang.Object
  extended by cytoscape.util.URLUtil

public class URLUtil
extends Object


Field Summary
static boolean STOP
           
 
Constructor Summary
URLUtil()
           
 
Method Summary
static void download(String urlString, File downloadFile, TaskMonitor taskMonitor)
          Download the file specified by the url string to the given File object
static String download(URL source)
          Get the the contents of the given URL as a string.
static InputStream getBasicInputStream(URL source)
          Obtain an InputStream for a given URL.
static InputStream getInputStream(URL source)
          Gets the an input stream given a URL.
static URLConnection getURLConnection(URL source)
          Obtain a URLConnection for a given URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP

public static boolean STOP
Constructor Detail

URLUtil

public URLUtil()
Method Detail

getInputStream

public static InputStream getInputStream(URL source)
                                  throws IOException
Gets the an input stream given a URL.

Parameters:
source - URL source for a zip or jar file.
Returns:
InputStream for given URL
Throws:
IOException

getBasicInputStream

public static InputStream getBasicInputStream(URL source)
                                       throws IOException
Obtain an InputStream for a given URL. Ensure proxy servers and an input stream to the real URL source is created--not a locally cached and out of date source. Proxy servers and other characteristics can cause pages to be cached.

Parameters:
source - the non-null URL from which to obtain an InputStream.
Returns:
InputStream from the source URL.
Throws:
IllegalStateException - if source is null.
IOException - if a connection to the URL can't be opened or a problem occurs with the InputStream.

getURLConnection

public static URLConnection getURLConnection(URL source)
                                      throws IOException
Obtain a URLConnection for a given URL. Ensure proxy servers are considered and page caching is ignored.

Parameters:
source - the non-null URL from which to obtain a URLConnection.
Returns:
URLConnection to the source URL.
Throws:
IllegalStateException - if source is null.
IOException - if a connection to the URL can't be opened.

download

public static void download(String urlString,
                            File downloadFile,
                            TaskMonitor taskMonitor)
                     throws IOException
Download the file specified by the url string to the given File object

Parameters:
urlString -
downloadFile -
taskMonitor -
Throws:
IOException

download

public static String download(URL source)
                       throws IOException
Get the the contents of the given URL as a string.

Parameters:
source -
Returns:
String
Throws:
IOException

www.cytoscape.org