URIResponse
, WarcRecord
, org.apache.http.HttpMessage
, org.apache.http.HttpResponse
public class HttpResponseWarcRecord extends AbstractWarcRecord implements org.apache.http.HttpResponse, URIResponse
WarcRecord
corresponding to a WarcRecord.Type.RESPONSE
record type.WarcRecord.Type
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
HTTP_RESPONSE_MSGTYPE |
USE_BURL_PROPERTY, warcHeaders
PROTOCOL_VERSION
Constructor | Description |
---|---|
HttpResponseWarcRecord(java.net.URI targetURI,
org.apache.http.HttpResponse response) |
Builds the record given the response and the target URI (using a
IdentityHttpEntityFactory to store the entity in the record). |
HttpResponseWarcRecord(java.net.URI targetURI,
org.apache.http.HttpResponse response,
HttpEntityFactory hef) |
Builds the record given the response, the target URI, and a
HttpEntityFactory . |
Modifier and Type | Method | Description |
---|---|---|
static HttpResponseWarcRecord |
fromPayload(org.apache.http.message.HeaderGroup warcHeaders,
BoundSessionInputBuffer payloadBuffer) |
|
org.apache.http.HttpEntity |
getEntity() |
|
java.util.Locale |
getLocale() |
Deprecated.
|
org.apache.http.ProtocolVersion |
getProtocolVersion() |
|
org.apache.http.StatusLine |
getStatusLine() |
|
org.apache.http.HttpResponse |
response() |
Returns the response part.
|
void |
setEntity(org.apache.http.HttpEntity entity) |
|
void |
setLocale(java.util.Locale loc) |
Deprecated.
|
void |
setReasonPhrase(java.lang.String reason) |
|
void |
setStatusCode(int code) |
|
void |
setStatusLine(org.apache.http.ProtocolVersion ver,
int code) |
|
void |
setStatusLine(org.apache.http.ProtocolVersion ver,
int code,
java.lang.String reason) |
|
void |
setStatusLine(org.apache.http.StatusLine statusline) |
|
java.lang.String |
toString() |
|
java.net.URI |
uri() |
Returns the URI part.
|
protected java.io.InputStream |
writePayload(ByteArraySessionOutputBuffer buffer) |
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
getWarcContentLength, getWarcDate, getWarcHeader, getWarcHeaders, getWarcRecordId, getWarcTargetURI, getWarcType, write, writeHeaders
public static final java.lang.String HTTP_RESPONSE_MSGTYPE
public HttpResponseWarcRecord(java.net.URI targetURI, org.apache.http.HttpResponse response) throws java.io.IOException
IdentityHttpEntityFactory
to store the entity in the record).targetURI
- the target URI.response
- the response.java.io.IOException
public HttpResponseWarcRecord(java.net.URI targetURI, org.apache.http.HttpResponse response, HttpEntityFactory hef) throws java.io.IOException
HttpEntityFactory
.targetURI
- the target URI.response
- the response.hef
- the HttpEntityFactory
to be used to create the entity stored in the record, if null
an IdentityHttpEntityFactory
will be used.java.io.IOException
public static HttpResponseWarcRecord fromPayload(org.apache.http.message.HeaderGroup warcHeaders, BoundSessionInputBuffer payloadBuffer) throws java.io.IOException
java.io.IOException
public org.apache.http.ProtocolVersion getProtocolVersion()
getProtocolVersion
in interface org.apache.http.HttpMessage
getProtocolVersion
in class AbstractWarcRecord
public org.apache.http.StatusLine getStatusLine()
getStatusLine
in interface org.apache.http.HttpResponse
public org.apache.http.HttpEntity getEntity()
getEntity
in interface org.apache.http.HttpResponse
protected java.io.InputStream writePayload(ByteArraySessionOutputBuffer buffer) throws java.io.IOException
writePayload
in class AbstractWarcRecord
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public void setStatusLine(org.apache.http.StatusLine statusline)
setStatusLine
in interface org.apache.http.HttpResponse
public void setStatusLine(org.apache.http.ProtocolVersion ver, int code)
setStatusLine
in interface org.apache.http.HttpResponse
public void setStatusLine(org.apache.http.ProtocolVersion ver, int code, java.lang.String reason)
setStatusLine
in interface org.apache.http.HttpResponse
public void setStatusCode(int code) throws java.lang.IllegalStateException
setStatusCode
in interface org.apache.http.HttpResponse
java.lang.IllegalStateException
public void setReasonPhrase(java.lang.String reason) throws java.lang.IllegalStateException
setReasonPhrase
in interface org.apache.http.HttpResponse
java.lang.IllegalStateException
public void setEntity(org.apache.http.HttpEntity entity)
setEntity
in interface org.apache.http.HttpResponse
@Deprecated public java.util.Locale getLocale()
getLocale
in interface org.apache.http.HttpResponse
@Deprecated public void setLocale(java.util.Locale loc)
setLocale
in interface org.apache.http.HttpResponse
public java.net.URI uri()
URIResponse
uri
in interface URIResponse
public org.apache.http.HttpResponse response()
URIResponse
response
in interface URIResponse