org.archive.wayback.resourcestore.resourcefile
Class WarcResource

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

public class WarcResource
extends Resource


Constructor Summary
WarcResource(org.archive.io.warc.WARCRecord rec, org.archive.io.warc.WARCReader reader)
           
 
Method Summary
 void close()
           
 Map<String,String> getHttpHeaders()
          Assumes an HTTP response - return the HTTP headers, not including the HTTP Message header
 long getRecordLength()
           
 int getStatusCode()
          Assumes an HTTP resource - return the HTTP response code
 void parseHeaders()
           
 
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

WarcResource

public WarcResource(org.archive.io.warc.WARCRecord rec,
                    org.archive.io.warc.WARCReader reader)
Method Detail

parseHeaders

public void parseHeaders()
                  throws IOException
Throws:
IOException

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:
key-value Map of HTTP headers

getRecordLength

public long getRecordLength()
Specified by:
getRecordLength in class Resource
Returns:
the size in bytes of the record payload, including HTTP header

getStatusCode

public int getStatusCode()
Description copied from class: Resource
Assumes an HTTP resource - return the HTTP response code

Specified by:
getStatusCode in class Resource
Returns:
the HTTP response code from the HTTP message

close

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


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