org.archive.wayback.liveweb
Class URLtoARCCacher

java.lang.Object
  extended by org.archive.wayback.liveweb.URLtoARCCacher

public class URLtoARCCacher
extends Object

Takes an input URL String argument, downloads, stores in an ARCWriter, and returns a FileRegion consisting of the compressed ARCRecord containing the response, or a forged, "fake error response" ARCRecord which can be used to send the content to an OutputStream.

Author:
brad

Constructor Summary
URLtoARCCacher()
           
 
Method Summary
 FileRegion cacheURL(String url, ARCCacheDirectory cache)
           
 String getBackingFileBase()
           
 int getConnectionTimeoutMS()
           
 String getRecorderCacheDir()
           
 int getSocketTimeoutMS()
           
 String getUserAgent()
           
 void setBackingFileBase(String backingFileBase)
           
 void setConnectionTimeoutMS(int connectionTimeoutMS)
           
 void setRecorderCacheDir(String recorderCacheDirPath)
           
 void setSocketTimeoutMS(int socketTimeoutMS)
           
 void setUserAgent(String userAgent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLtoARCCacher

public URLtoARCCacher()
Method Detail

cacheURL

public FileRegion cacheURL(String url,
                           ARCCacheDirectory cache)
                    throws IOException,
                           org.apache.commons.httpclient.URIException
Parameters:
url - to cache
cache - ARCCacheDirectory for storing result or faked result
Returns:
FileRegion of compressed byte range for ARCRecord.
Throws:
IOException - for the usual reasons
org.apache.commons.httpclient.URIException - if url argument isn't really an URL..

getRecorderCacheDir

public String getRecorderCacheDir()
Returns:
the recorderCacheDir

setRecorderCacheDir

public void setRecorderCacheDir(String recorderCacheDirPath)
Parameters:
recorderCacheDirPath - the recorderCacheDir to set

getBackingFileBase

public String getBackingFileBase()
Returns:
the backingFileBase

setBackingFileBase

public void setBackingFileBase(String backingFileBase)
Parameters:
backingFileBase - the backingFileBase to set

getUserAgent

public String getUserAgent()
Returns:
the userAgent

setUserAgent

public void setUserAgent(String userAgent)
Parameters:
userAgent - the userAgent to set

getConnectionTimeoutMS

public int getConnectionTimeoutMS()
Returns:
the connectionTimeoutMS

setConnectionTimeoutMS

public void setConnectionTimeoutMS(int connectionTimeoutMS)
Parameters:
connectionTimeoutMS - the connectionTimeoutMS to set

getSocketTimeoutMS

public int getSocketTimeoutMS()
Returns:
the socketTimeoutMS

setSocketTimeoutMS

public void setSocketTimeoutMS(int socketTimeoutMS)
Parameters:
socketTimeoutMS - the socketTimeoutMS to set


Copyright © 2005-2011 Internet Archive. All Rights Reserved.