org.archive.wayback.liveweb
Class ARCCacheDirectory

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

public class ARCCacheDirectory
extends java.lang.Object

Class which manages a growing set of ARC files, managed by an ARCWriterPool. Clients can grab an ARCWriter that they use to append to one of the ARC files. This class also transforms ARCLocations into ARCRecords, using an ARCReader.

Version:
$Date$, $Revision$
Author:
brad

Field Summary
static java.lang.String LIVE_WEB_ARC_DIR
          directory where live generated ARCs are stored
static java.lang.String LIVE_WEB_ARC_PREFIX
          prefeix for live generated ARC files.
 
Constructor Summary
ARCCacheDirectory()
           
 
Method Summary
 java.lang.String getArcDir()
           
 java.lang.String getArcPrefix()
           
 Resource getResource(java.lang.String path, long offset)
          transform an ARCLocation into a Resource.
 org.archive.io.arc.ARCWriter getWriter()
          get an ARCWriter.
 void init()
           
 void returnWriter(org.archive.io.arc.ARCWriter w)
           
 void setArcDir(java.lang.String arcPath)
           
 void setArcPrefix(java.lang.String arcPrefix)
           
 void shutdown()
          shut down the ARC Writer pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIVE_WEB_ARC_DIR

public static final java.lang.String LIVE_WEB_ARC_DIR
directory where live generated ARCs are stored

See Also:
Constant Field Values

LIVE_WEB_ARC_PREFIX

public static final java.lang.String LIVE_WEB_ARC_PREFIX
prefeix for live generated ARC files.

See Also:
Constant Field Values
Constructor Detail

ARCCacheDirectory

public ARCCacheDirectory()
Method Detail

init

public void init()
          throws java.io.IOException
Throws:
java.io.IOException

shutdown

public void shutdown()
shut down the ARC Writer pool.


getWriter

public org.archive.io.arc.ARCWriter getWriter()
                                       throws java.io.IOException
get an ARCWriter. be sure to return it to the pool with returnWriter.

Returns:
an ARCWriter prepared to store an ARCRecord
Throws:
java.io.IOException

returnWriter

public void returnWriter(org.archive.io.arc.ARCWriter w)
                  throws java.io.IOException
Parameters:
w - previously borrowed ARCWriter
Throws:
java.io.IOException

getResource

public Resource getResource(java.lang.String path,
                            long offset)
                     throws java.io.IOException
transform an ARCLocation into a Resource. Be sure to call close() on it when processing is finished.

Parameters:
path -
offset -
Returns:
the Resource for the location
Throws:
java.io.IOException

getArcPrefix

public java.lang.String getArcPrefix()
Returns:
the arcPrefix

setArcPrefix

public void setArcPrefix(java.lang.String arcPrefix)
Parameters:
arcPrefix - the arcPrefix to set

getArcDir

public java.lang.String getArcDir()
Returns:
the arcDir

setArcDir

public void setArcDir(java.lang.String arcPath)
Parameters:
arcPath - the arcPath to set


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