ice.storm
Class ContentLoader

java.lang.Object
  extended byice.storm.ContentLoader

public class ContentLoader
extends Object

This class encapsulates a data source. There are a number of ways of specifying content, ranging from a simple url, through a supplied URLConnection, to just giving an InputStream containing the actual content.


Constructor Summary
ContentLoader(String url, String contentType)
          Specify the content through an URL.
ContentLoader(URLConnection urlc, String contentType)
          Specify the content by suppling a URLConnection which represents the resource.
ContentLoader(URL base, InputStream in, String contentType)
          Some content is present in the supplied InputStream.
ContentLoader(URL u, String contentType)
          Specify the content through an URL.
ContentLoader(URL base, String loc, String contentType)
          Specify the content by using a URL as base location and a string as the relative location.
 
Method Summary
 String getContentCharset()
           
 String getContentType()
           
 CookieSet getCookieSet()
           
 IOException getException()
           
 String getHeaderField(int i)
           
 String getHeaderFieldKey(int i)
           
 InputStream getInputStream()
           
 String getLocation()
           
 Hashtable getParams()
           
 byte[] getPostData()
           
 boolean getRedirected()
           
 String getReferer()
           
 String getRequestProperty(String property)
           
 URL getURL()
           
 URLConnection getURLConnection()
          Will create the URLConnection, but not connect it.
 boolean isFromHistory()
           
protected  URLConnection openConnection(URL url)
          Returns a URLConnection object that represents a connection to the remote object referred to by the url.
 void setIframe(boolean flag)
           
protected  void setInputStream(InputStream inputStream)
           
 void setParams(Hashtable h)
           
 void setPostData(String type, byte[] d)
           
 void setPostStream(String type, InputStream ioStream)
           
 void setRedirected(boolean flag)
           
 void setReferer(String r)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentLoader

public ContentLoader(URL u,
                     String contentType)
Specify the content through an URL.


ContentLoader

public ContentLoader(String url,
                     String contentType)
Specify the content through an URL.


ContentLoader

public ContentLoader(URL base,
                     String loc,
                     String contentType)
Specify the content by using a URL as base location and a string as the relative location.


ContentLoader

public ContentLoader(URLConnection urlc,
                     String contentType)
Specify the content by suppling a URLConnection which represents the resource.


ContentLoader

public ContentLoader(URL base,
                     InputStream in,
                     String contentType)
Some content is present in the supplied InputStream. The URL supplied is used for resolving any relative links on the supplied content.

Method Detail

setRedirected

public void setRedirected(boolean flag)

getRedirected

public boolean getRedirected()

setIframe

public void setIframe(boolean flag)

isFromHistory

public boolean isFromHistory()

getReferer

public String getReferer()

setReferer

public void setReferer(String r)

setPostData

public void setPostData(String type,
                        byte[] d)

setPostStream

public void setPostStream(String type,
                          InputStream ioStream)

getPostData

public byte[] getPostData()

getContentType

public String getContentType()

getURL

public URL getURL()

getURLConnection

public URLConnection getURLConnection()
Will create the URLConnection, but not connect it.


getRequestProperty

public String getRequestProperty(String property)

getHeaderFieldKey

public String getHeaderFieldKey(int i)

getHeaderField

public String getHeaderField(int i)

getCookieSet

public CookieSet getCookieSet()

getInputStream

public InputStream getInputStream()

setInputStream

protected void setInputStream(InputStream inputStream)

getContentCharset

public String getContentCharset()

getLocation

public String getLocation()

setParams

public void setParams(Hashtable h)

getParams

public Hashtable getParams()

getException

public IOException getException()

toString

public String toString()

openConnection

protected URLConnection openConnection(URL url)
                                throws IOException
Returns a URLConnection object that represents a connection to the remote object referred to by the url.

A new connection is opened every time by calling the openConnection method of the protocol handler for url.

For HTTP, an HttpURLConnection will be returned.

Parameters:
url - the url from which URLConnection is opened.
Returns:
a URLConnection to the url.
Throws:
IOException - if an I/O exception occurs.
See Also:
URLConnection, URLStreamHandler.openConnection(java.net.URL)