|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.client.testing.http.MockHttpContent
public class MockHttpContent
Mock for HttpContent
.
Implementation is not thread-safe.
Field Summary | |
---|---|
byte[] |
content
Deprecated. (scheduled to be made private in 1.6) Use getContent() or
setContent(byte[]) |
String |
encoding
Deprecated. (scheduled to be made private in 1.6) Use getEncoding() or
setEncoding(java.lang.String) |
long |
length
Deprecated. (scheduled to be made private in 1.6) Use getLength() or setLength(long) |
String |
type
Deprecated. (scheduled to be made private in 1.6) Use getType() or setType(java.lang.String) |
Constructor Summary | |
---|---|
MockHttpContent()
|
Method Summary | |
---|---|
byte[] |
getContent()
Returns the HTTP content. |
String |
getEncoding()
Returns the content encoding (for example "gzip" ) or null for none. |
long |
getLength()
Returns the content length or less than zero if not known. |
String |
getType()
Returns the content type or null for none. |
boolean |
retrySupported()
Returns whether or not retry is supported on this content type. |
MockHttpContent |
setContent(byte[] content)
Sets the HTTP content. |
MockHttpContent |
setEncoding(String encoding)
Sets the HTTP content encoding or null for none. |
MockHttpContent |
setLength(long length)
Returns the HTTP content length or -1 for unknown. |
MockHttpContent |
setType(String type)
Sets the HTTP content type or null for none. |
void |
writeTo(OutputStream out)
Writes the content to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public String encoding
getEncoding()
or
setEncoding(java.lang.String)
null
by default.
@Deprecated public long length
getLength()
or setLength(long)
-1
by default.
@Deprecated public String type
getType()
or setType(java.lang.String)
null
by default.
@Deprecated public byte[] content
getContent()
or
setContent(byte[])
Constructor Detail |
---|
public MockHttpContent()
Method Detail |
---|
public String getEncoding()
HttpContent
"gzip"
) or null
for none.
getEncoding
in interface HttpContent
public long getLength() throws IOException
HttpContent
getLength
in interface HttpContent
IOException
public String getType()
HttpContent
null
for none.
getType
in interface HttpContent
public void writeTo(OutputStream out) throws IOException
HttpContent
writeTo
in interface HttpContent
IOException
public boolean retrySupported()
HttpContent
retrySupported
in interface HttpContent
public final byte[] getContent()
public MockHttpContent setContent(byte[] content)
Default value is an empty byte array.
public MockHttpContent setEncoding(String encoding)
null
for none.
public MockHttpContent setLength(long length)
-1
for unknown.
Default value is -1
.
public MockHttpContent setType(String type)
null
for none.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |