org.archive.wayback.core
Class Resource

java.lang.Object
  extended by java.io.InputStream
      extended by org.archive.wayback.core.Resource
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
ArcResource, WarcResource

public abstract class Resource
extends java.io.InputStream

Abstraction on top of a document stored in a WaybackCollection. Currently implemented subclasses include ArcResource and WarcResource.

Version:
$Date: 2007-11-27 18:00:31 -0800 (Tue, 27 Nov 2007) $, $Revision: 2082 $
Author:
Brad Tofel

Constructor Summary
Resource()
           
 
Method Summary
 int available()
           
abstract  void close()
           
abstract  java.util.Map<java.lang.String,java.lang.String> getHttpHeaders()
           
abstract  long getRecordLength()
           
abstract  int getStatusCode()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
protected  void setInputStream(java.io.InputStream is)
           
 long skip(long n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource()
Method Detail

close

public abstract void close()
                    throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException

getStatusCode

public abstract int getStatusCode()

getRecordLength

public abstract long getRecordLength()

getHttpHeaders

public abstract java.util.Map<java.lang.String,java.lang.String> getHttpHeaders()

setInputStream

protected void setInputStream(java.io.InputStream is)

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Returns:
Throws:
java.io.IOException
See Also:
BufferedInputStream.available()

mark

public void mark(int readlimit)
Overrides:
mark in class java.io.InputStream
Parameters:
readlimit -
See Also:
BufferedInputStream.mark(int)

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.InputStream
Returns:
See Also:
BufferedInputStream.markSupported()

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Returns:
Throws:
java.io.IOException
See Also:
BufferedInputStream.read()

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Parameters:
b -
off -
len -
Returns:
Throws:
java.io.IOException
See Also:
BufferedInputStream.read(byte[], int, int)

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Parameters:
b -
Returns:
Throws:
java.io.IOException
See Also:
FilterInputStream.read(byte[])

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException
See Also:
BufferedInputStream.reset()

skip

public long skip(long n)
          throws java.io.IOException
Overrides:
skip in class java.io.InputStream
Parameters:
n -
Returns:
Throws:
java.io.IOException
See Also:
BufferedInputStream.skip(long)


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