Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all resources associated with the entity.
|
Entity |
getEntity()
Returns the entity.
|
Headers |
getHeaders()
Returns the headers.
|
String |
getVersion()
Returns the protocol version.
|
T |
setEntity(Object o)
Sets the content of the entity to the provided value.
|
T |
setVersion(String version)
Sets the protocol version.
|
public final Headers getHeaders()
public final String getVersion()
HTTP/1.1
.public final T setEntity(Object o) throws IOException
Content-Length
header, overwriting any existing header.
This method is intended mostly as a convenience method within scripts. The parameter will be handled depending on its type as follows:
BranchingInputStream
- equivalent to calling
Entity.setRawInputStream(org.forgerock.openig.io.BranchingInputStream)
byte[]
- equivalent to calling Entity.setBytes(byte[])
String
- equivalent to calling Entity.setString(java.lang.String)
Object
- equivalent to calling Entity.setJson(java.lang.Object)
.
Note: This method does not attempt to encode the entity based-on any
codings specified in the Content-Encoding
header.
o
- The object whose value should be stored in the entity.IOException
- If an IO error occurred while reading/mapping the content.public final T setVersion(String version)
HTTP/1.1
.version
- The protocol version.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Entity.close()
Copyright © 2014 ForgeRock AS. All rights reserved.