net.krecan.m2_proxy.repository.httpclient
Class HttpClientRepository

java.lang.Object
  extended by net.krecan.m2_proxy.repository.httpclient.HttpClientRepository
All Implemented Interfaces:
Repository

public class HttpClientRepository
extends Object
implements Repository

HttpClient backed repository implementation.

Author:
krel

Constructor Summary
HttpClientRepository()
           
 
Method Summary
protected  Resource downloadResource(String logicalName, String pathToResource, int redirectLevel)
          Downloads resource, handles redirects
 URL getBaseUrl()
           
 org.apache.commons.httpclient.HttpClient getHttpClient()
           
 int getMaxRedirects()
           
protected  boolean isRedirect(int response)
           
 Resource loadResource(String logicalName)
          Loads resources.
 void setBaseUrl(URL baseUrl)
           
 void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
           
 void setMaxRedirects(int maxRedirects)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientRepository

public HttpClientRepository()
Method Detail

loadResource

public Resource loadResource(String logicalName)
                      throws IOException
Description copied from interface: Repository
Loads resources. When the resource can not be loaded, returns null

Specified by:
loadResource in interface Repository
Returns:
returns resource
Throws:
IOException

downloadResource

protected Resource downloadResource(String logicalName,
                                    String pathToResource,
                                    int redirectLevel)
                             throws IOException,
                                    org.apache.commons.httpclient.HttpException
Downloads resource, handles redirects

Parameters:
logicalName -
pathToResource -
Returns:
Throws:
IOException
org.apache.commons.httpclient.HttpException

isRedirect

protected boolean isRedirect(int response)

getBaseUrl

public URL getBaseUrl()

setBaseUrl

public void setBaseUrl(URL baseUrl)

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient()

setHttpClient

public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)

getMaxRedirects

public int getMaxRedirects()

setMaxRedirects

public void setMaxRedirects(int maxRedirects)


Copyright © 2006 null. All Rights Reserved.