public class HeaderedArchiveRecord extends ArchiveRecord
| Modifier and Type | Class and Description |
|---|---|
static class |
HeaderedArchiveRecord.UnexpectedStartLineIOException |
digest, eor, header, in, MIN_HTTP_HEADER_LENGTH, position, strict| Constructor and Description |
|---|
HeaderedArchiveRecord(ArchiveRecord ar) |
HeaderedArchiveRecord(ArchiveRecord ar,
boolean readContentHeader) |
| Modifier and Type | Method and Description |
|---|---|
int |
available()
This available is not the stream's available.
|
void |
close()
Calling close on a record skips us past this record to the next record
in the stream.
|
void |
dump()
Writes output on STDOUT.
|
void |
dump(OutputStream os)
Writes output on passed
os. |
void |
dumpHttpHeader() |
void |
dumpHttpHeader(PrintStream stream) |
org.apache.commons.httpclient.Header[] |
getContentHeaders() |
int |
getContentHeadersLength() |
protected String |
getDigest4Cdx(ArchiveRecordHeader h) |
String |
getDigestStr() |
ArchiveRecordHeader |
getHeader() |
protected String |
getIp4Cdx(ArchiveRecordHeader h) |
protected String |
getMimetype4Cdx(ArchiveRecordHeader h) |
long |
getPosition() |
int |
getStatusCode() |
protected String |
getStatusCode4Cdx(ArchiveRecordHeader h) |
boolean |
hasContentHeaders()
Is it likely that this record contains headers?
This method will return true if the body is a http response that includes
http response headers or the body is a http request that includes request
headers, etc.
|
protected void |
incrementPosition() |
protected void |
incrementPosition(long incr) |
protected boolean |
isEor() |
boolean |
isStrict() |
boolean |
markSupported() |
protected String |
outputCdx(String strippedFileName) |
int |
read() |
int |
read(byte[] b,
int offset,
int length) |
protected void |
setEor(boolean eor) |
protected void |
setHeader(ArchiveRecordHeader header) |
void |
setStrict(boolean strict) |
protected void |
skip()
Skip over this records content.
|
long |
skip(long n) |
void |
skipHttpHeader()
Skip over the the content headers if present.
|
getIn, setBodyOffsetmark, read, resetpublic HeaderedArchiveRecord(ArchiveRecord ar) throws IOException
IOExceptionpublic HeaderedArchiveRecord(ArchiveRecord ar, boolean readContentHeader) throws IOException
IOExceptionpublic void skipHttpHeader()
throws IOException
Calling this method in the midst of reading the header will make for strange results. Otherwise, safe to call at any time though before reading any of the record content is only time that it makes sense.
After calling this method, you can call
getContentHeaders() to get the read http header.
IOExceptionpublic void dumpHttpHeader()
throws IOException
IOExceptionpublic void dumpHttpHeader(PrintStream stream) throws IOException
IOExceptionpublic int getStatusCode()
public int getContentHeadersLength()
public org.apache.commons.httpclient.Header[] getContentHeaders()
public int read()
throws IOException
read in class ArchiveRecordIOExceptionpublic int read(byte[] b,
int offset,
int length)
throws IOException
read in class ArchiveRecordIOExceptionpublic int available()
ArchiveRecordavailable in class ArchiveRecordpublic void close()
throws IOException
ArchiveRecordclose in interface Closeableclose in interface AutoCloseableclose in class ArchiveRecordIOExceptionpublic void dump()
throws IOException
ArchiveRecorddump in class ArchiveRecordIOExceptionpublic void dump(OutputStream os) throws IOException
ArchiveRecordos.dump in class ArchiveRecordIOExceptionprotected String getDigest4Cdx(ArchiveRecordHeader h)
getDigest4Cdx in class ArchiveRecordpublic String getDigestStr()
getDigestStr in class ArchiveRecordpublic ArchiveRecordHeader getHeader()
getHeader in class ArchiveRecordprotected String getIp4Cdx(ArchiveRecordHeader h)
getIp4Cdx in class ArchiveRecordprotected String getMimetype4Cdx(ArchiveRecordHeader h)
getMimetype4Cdx in class ArchiveRecordpublic long getPosition()
getPosition in class ArchiveRecordprotected String getStatusCode4Cdx(ArchiveRecordHeader h)
getStatusCode4Cdx in class ArchiveRecordpublic boolean hasContentHeaders()
ArchiveRecordArchiveRecordHeader 'headers'.hasContentHeaders in class ArchiveRecordprotected void incrementPosition()
incrementPosition in class ArchiveRecordprotected void incrementPosition(long incr)
incrementPosition in class ArchiveRecordprotected boolean isEor()
isEor in class ArchiveRecordpublic boolean isStrict()
isStrict in class ArchiveRecordpublic boolean markSupported()
markSupported in class ArchiveRecordprotected String outputCdx(String strippedFileName) throws IOException
outputCdx in class ArchiveRecordIOExceptionprotected void setEor(boolean eor)
setEor in class ArchiveRecordprotected void setHeader(ArchiveRecordHeader header)
setHeader in class ArchiveRecordpublic void setStrict(boolean strict)
setStrict in class ArchiveRecordstrict - The strict to set.protected void skip()
throws IOException
ArchiveRecordskip in class ArchiveRecordIOExceptionpublic long skip(long n)
throws IOException
skip in class ArchiveRecordIOExceptionCopyright © 2015 The International Internet Preservation Consortium. All Rights Reserved.