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(java.io.OutputStream os)
Writes output on passed
os. |
void |
dumpHttpHeader() |
void |
dumpHttpHeader(java.io.PrintStream stream) |
org.apache.commons.httpclient.Header[] |
getContentHeaders() |
int |
getContentHeadersLength() |
protected java.lang.String |
getDigest4Cdx(ArchiveRecordHeader h) |
java.lang.String |
getDigestStr() |
ArchiveRecordHeader |
getHeader() |
protected java.lang.String |
getIp4Cdx(ArchiveRecordHeader h) |
protected java.lang.String |
getMimetype4Cdx(ArchiveRecordHeader h) |
long |
getPosition() |
int |
getStatusCode() |
protected java.lang.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 java.lang.String |
outputCdx(java.lang.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, setBodyOffsetpublic HeaderedArchiveRecord(ArchiveRecord ar) throws java.io.IOException
java.io.IOExceptionpublic HeaderedArchiveRecord(ArchiveRecord ar, boolean readContentHeader) throws java.io.IOException
java.io.IOExceptionpublic void skipHttpHeader()
throws java.io.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.
java.io.IOExceptionpublic void dumpHttpHeader()
throws java.io.IOException
java.io.IOExceptionpublic void dumpHttpHeader(java.io.PrintStream stream)
throws java.io.IOException
java.io.IOExceptionpublic int getStatusCode()
public int getContentHeadersLength()
public org.apache.commons.httpclient.Header[] getContentHeaders()
public int read()
throws java.io.IOException
read in class ArchiveRecordjava.io.IOExceptionpublic int read(byte[] b,
int offset,
int length)
throws java.io.IOException
read in class ArchiveRecordjava.io.IOExceptionpublic int available()
ArchiveRecordavailable in class ArchiveRecordpublic void close()
throws java.io.IOException
ArchiveRecordclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class ArchiveRecordjava.io.IOExceptionpublic void dump()
throws java.io.IOException
ArchiveRecorddump in class ArchiveRecordjava.io.IOExceptionpublic void dump(java.io.OutputStream os)
throws java.io.IOException
ArchiveRecordos.dump in class ArchiveRecordjava.io.IOExceptionprotected java.lang.String getDigest4Cdx(ArchiveRecordHeader h)
getDigest4Cdx in class ArchiveRecordpublic java.lang.String getDigestStr()
getDigestStr in class ArchiveRecordpublic ArchiveRecordHeader getHeader()
getHeader in class ArchiveRecordprotected java.lang.String getIp4Cdx(ArchiveRecordHeader h)
getIp4Cdx in class ArchiveRecordprotected java.lang.String getMimetype4Cdx(ArchiveRecordHeader h)
getMimetype4Cdx in class ArchiveRecordpublic long getPosition()
getPosition in class ArchiveRecordprotected java.lang.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 java.lang.String outputCdx(java.lang.String strippedFileName)
throws java.io.IOException
outputCdx in class ArchiveRecordjava.io.IOExceptionprotected 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 java.io.IOException
ArchiveRecordskip in class ArchiveRecordjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class ArchiveRecordjava.io.IOExceptionCopyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.