org.crosswire.common.util
Class WebResource

java.lang.Object
  extended by org.crosswire.common.util.WebResource

public class WebResource
extends Object

A WebResource is backed by an URL and potentially the proxy through which it need go. It can get basic information about the resource and it can get the resource.

Author:
DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
private  org.apache.commons.httpclient.HttpClient client
           
private  URI uri
           
 
Constructor Summary
WebResource(URI theURI)
           
WebResource(URI theURI, String theProxyHost)
           
WebResource(URI theURI, String theProxyHost, Integer theProxyPort)
           
 
Method Summary
 void copy(URI dest)
          Copy this WebResource to the destination.
 long getLastModified()
          Determine the last modified date of this WebResource.
 int getSize()
          Determine the size of this WebResource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uri

private URI uri

client

private org.apache.commons.httpclient.HttpClient client
Constructor Detail

WebResource

public WebResource(URI theURI)

WebResource

public WebResource(URI theURI,
                   String theProxyHost)

WebResource

public WebResource(URI theURI,
                   String theProxyHost,
                   Integer theProxyPort)
Method Detail

getSize

public int getSize()
Determine the size of this WebResource.

Note that the http client may read the entire file to determine this.

Returns:
the size of the file

getLastModified

public long getLastModified()
Determine the last modified date of this WebResource.

Note that the http client may read the entire file.

Returns:
the last mod date of the file

copy

public void copy(URI dest)
          throws LucidException
Copy this WebResource to the destination.

Parameters:
dest -
Throws:
LucidException

Copyright ยจ 2003-2007