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 Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public 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 null
yyyyMMddHHmmss
)public void parseHeaders() throws IOException
IOException
protected 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 InputStream
IOException
public void mark(int readlimit)
mark
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public void reset() throws IOException
reset
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
Copyright © 2005–2015 IIPC. All rights reserved.