org.archive.wayback.resourcestore.resourcefile
Class ArcResource

java.lang.Object
  extended by java.io.InputStream
      extended by org.archive.wayback.core.Resource
          extended by org.archive.wayback.resourcestore.resourcefile.ArcResource
All Implemented Interfaces:
Closeable

public class ArcResource
extends Resource


Constructor Summary
ArcResource(org.archive.io.arc.ARCRecord rec, org.archive.io.arc.ARCReader reader)
          Constructor
 
Method Summary
 void close()
           
 Map<String,String> filterMeta(String prefix)
           
 Map<String,String> getARCMetadata()
           
 org.archive.io.ArchiveRecord getArcRecord()
           
 Map<String,String> getHttpHeaders()
          Assumes an HTTP response - return the HTTP headers, not including the HTTP Message header
 long getRecordLength()
           
 int getStatusCode()
          (non-Javadoc)
 void parseHeaders()
          parse the headers on the underlying ARC record, and extract all
 
Methods inherited from class org.archive.wayback.core.Resource
available, mark, markSupported, read, read, read, reset, setChunkedEncoding, setInputStream, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArcResource

public ArcResource(org.archive.io.arc.ARCRecord rec,
                   org.archive.io.arc.ARCReader reader)
Constructor

Parameters:
rec -
reader -
Method Detail

parseHeaders

public void parseHeaders()
                  throws IOException
parse the headers on the underlying ARC record, and extract all

Throws:
IOException

filterMeta

public Map<String,String> filterMeta(String prefix)
Parameters:
prefix -
Returns:
a Properties of all elements in metaData starting with 'prefix'. keys in the returned Properties have 'prefix' removed.

getHttpHeaders

public Map<String,String> getHttpHeaders()
Description copied from class: Resource
Assumes an HTTP response - return the HTTP headers, not including the HTTP Message header

Specified by:
getHttpHeaders in class Resource
Returns:
a Properties containing all HTTP header fields for this record

getARCMetadata

public Map<String,String> getARCMetadata()
Returns:
a Properties containing all ARC Meta fields for this record

getStatusCode

public int getStatusCode()
(non-Javadoc)

Specified by:
getStatusCode in class Resource
Returns:
int HTTP status code returned with this document.
See Also:
ARCRecord.getStatusCode()

getArcRecord

public org.archive.io.ArchiveRecord getArcRecord()
Returns:
the ARCRecord underlying this Resource.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Resource
Throws:
IOException

getRecordLength

public long getRecordLength()
Specified by:
getRecordLength in class Resource
Returns:
byte length claimed in ARC record metadata line.


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