jautil
Class URLDataLoader

java.lang.Object
  extended by jautil.URLDataLoader

public class URLDataLoader
extends java.lang.Object

The primary function of a URLDataLoader is to read the data from a given URL into an internal byte array. If necessary, that is, if the volume of data and the speed of the connection warrant it, a progress dialog is displayed during the download. Accessor methods are provided for the downloaded data array and for the source URL.


Constructor Summary
URLDataLoader(java.lang.String url, java.lang.String tag)
          Constructs a new URLDataLoader for the given URL, using the given descriptive tag in any progress dialog if one is used during the download.
 
Method Summary
static byte[] getURLData(java.lang.String url, java.lang.String tag)
          Downloads the data from a given URL, using the given descriptive tag in the progress dialog, if any, and returns the data as a byte array.
 java.lang.String url()
          Returns the source URL for this loader.
 byte[] urlData()
          Returns the data obtained by this loader, or null in case of error.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLDataLoader

public URLDataLoader(java.lang.String url,
                     java.lang.String tag)
Constructs a new URLDataLoader for the given URL, using the given descriptive tag in any progress dialog if one is used during the download.

Method Detail

getURLData

public static byte[] getURLData(java.lang.String url,
                                java.lang.String tag)
Downloads the data from a given URL, using the given descriptive tag in the progress dialog, if any, and returns the data as a byte array.


urlData

public byte[] urlData()
Returns the data obtained by this loader, or null in case of error.


url

public java.lang.String url()
Returns the source URL for this loader.