content
Input stream content of HTTP response or
null
by default.private InputStream
null
by default.private String
null
for none.private long
-1
if unknown.private String
null
by default.private boolean
disconnect()
has been called.private String
null
for none.private int
200
by default.void
null
for none."gzip"
) or null
for none.long
0
for none.final String
null
for none.int
getHeaderName(int index)
getHeaderValue(int index)
null
for none.int
<=0
for none.null
for none.boolean
disconnect()
has been called.setContent(byte[] byteContent)
setContent(InputStream content)
null
for none.setContent(String stringContent)
setContentEncoding(String contentEncoding)
null
for none.setContentLength(long contentLength)
-1
for unknown.setContentType(String contentType)
null
for none.setHeaderNames(List<String> headerNames)
setHeaderValues(List<String> headerValues)
setReasonPhrase(String reasonPhrase)
null
for none.setStatusCode(int statusCode)
null
and the content length to 0.null
by default.null
by default.200
by default.null
for none.null
for none.-1
if unknown.disconnect()
has been called.name
- header namevalue
- header valueIf the input string is null
, it will set the content to null
. Else, it will
use TestableByteArrayInputStream
with the UTF-8 encoded string content.
stringContent
- content string or null
for nonebyteContent
- content byte array, or null
for none.
If the byte array is null
, the method invokes setZeroContent()
.
Otherwise, byteContent
is wrapped in a TestableByteArrayInputStream
and
becomes this MockLowLevelHttpResponse
's contents.
null
and the content length to 0. Note that the result will have a
content length header whose value is 0.LowLevelHttpResponse
null
for none.getContent
in class LowLevelHttpResponse
IOException
- I/O exceptionLowLevelHttpResponse
"gzip"
) or null
for none.getContentEncoding
in class LowLevelHttpResponse
LowLevelHttpResponse
0
for none.getContentLength
in class LowLevelHttpResponse
LowLevelHttpResponse
null
for none.getContentType
in class LowLevelHttpResponse
LowLevelHttpResponse
Note that multiple headers of the same name need to be supported, in which case each header value is treated as a separate header.
getHeaderCount
in class LowLevelHttpResponse
LowLevelHttpResponse
getHeaderName
in class LowLevelHttpResponse
LowLevelHttpResponse
getHeaderValue
in class LowLevelHttpResponse
LowLevelHttpResponse
null
for none.getReasonPhrase
in class LowLevelHttpResponse
LowLevelHttpResponse
<=0
for none.getStatusCode
in class LowLevelHttpResponse
LowLevelHttpResponse
null
for none.getStatusLine
in class LowLevelHttpResponse
Default value is an empty list.
Default value is an empty list.
null
for none.null
for none.null
for none.-1
for unknown.
By default it is -1
.
Default value is 200
.
null
for none.LowLevelHttpResponse
disconnect
in class LowLevelHttpResponse
IOException
- I/O exceptiondisconnect()
has been called.