Cytoscape 2.8.0 API

cytoscape.util
Class URLUtil

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

public class URLUtil
extends Object


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.
static boolean isValid(String urlCandidate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

isValid

public static boolean isValid(String urlCandidate)

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.