public abstract class Resource extends InputStream
ResourceStore.retrieveResource(CaptureSearchResult)| Constructor and Description |
|---|
Resource() |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
abstract void |
close() |
String |
getHeader(String headerName) |
abstract Map<String,String> |
getHttpHeaders()
Assumes an HTTP response - return the HTTP headers, not including the
HTTP Message header
|
abstract long |
getRecordLength() |
String |
getRefersToDate()
return
WARC-Refers-To-Date WARC record header value or
equivalent. |
String |
getRefersToTargetURI()
return
WARC-Refer-To-Target-URI WARC record header value or
equivalent. |
abstract int |
getStatusCode()
Assumes an HTTP resource - return the HTTP response code
|
void |
mark(int readlimit) |
boolean |
markSupported() |
void |
parseHeaders() |
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) |
public abstract void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic abstract int getStatusCode()
public abstract long getRecordLength()
public abstract Map<String,String> getHttpHeaders()
public String getRefersToTargetURI()
WARC-Refer-To-Target-URI WARC record header value or
equivalent.
Default implementation returns null.public String getRefersToDate()
WARC-Refers-To-Date WARC record header value or
equivalent.
Default implementation returns nullyyyyMMddHHmmss)public void parseHeaders()
throws IOException
IOExceptionprotected void setInputStream(InputStream is)
public void setChunkedEncoding()
throws IOException
Transfer-Encoding: chunked header, so the input
data should be dechunked as it is read. This method actually peeks
ahead to verify that there is a hex-encoded chunk length before
assuming the data is chunked.IOException - for usual reasonspublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStreampublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionCopyright © 2005–2015 IIPC. All rights reserved.