|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.archive.wayback.core.Resource
public abstract class Resource
Abstraction on top of a document stored in a WaybackCollection. Currently implemented subclasses include ArcResource and WarcResource. This implementation needs some pretty drastic refactoring.. May have to wait for 2.0. This should be a byte-oriented record, and allow wrapping the interior byte-stream in on the more full featured HTTP libraries (jetty/apache-http-client/w3c-http-reference). For now, it is a system-wide assumption that all resources are HTTP based.
| Constructor Summary | |
|---|---|
Resource()
|
|
| Method Summary | |
|---|---|
int |
available()
|
abstract void |
close()
|
abstract Map<String,String> |
getHttpHeaders()
Assumes an HTTP response - return the HTTP headers, not including the HTTP Message header |
abstract long |
getRecordLength()
|
abstract int |
getStatusCode()
Assumes an HTTP resource - return the HTTP response code |
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b)
|
int |
read(byte[] b,
int off,
int len)
|
void |
reset()
|
void |
setChunkedEncoding()
indicate that there is a Transfer-Encoding: chunked header, so the input data should be dechunked as it is read. |
protected void |
setInputStream(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 |
|---|
public Resource()
| Method Detail |
|---|
public abstract void close()
throws IOException
close in interface Closeableclose in class InputStreamIOExceptionpublic abstract int getStatusCode()
public abstract long getRecordLength()
public abstract Map<String,String> getHttpHeaders()
protected void setInputStream(InputStream is)
public void setChunkedEncoding()
throws IOException
IOException - for usual reasons
public int available()
throws IOException
available in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStream
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException
public int read(byte[] b)
throws IOException
read in class InputStreamIOException
public void reset()
throws IOException
reset in class InputStreamIOException
public long skip(long n)
throws IOException
skip in class InputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||