@Singleton public class DefaultServletToAwsProxyResponseAdapter extends java.lang.Object implements ServletToAwsProxyResponseAdapter
DefaultImplementation
of ServletToAwsProxyResponseAdapter
.Constructor and Description |
---|
DefaultServletToAwsProxyResponseAdapter() |
Modifier and Type | Method and Description |
---|---|
protected java.nio.charset.Charset |
getBodyCharset() |
void |
handle(javax.servlet.http.HttpServletRequest request,
com.amazonaws.serverless.proxy.model.AwsProxyResponse awsProxyResponse,
javax.servlet.http.HttpServletResponse response)
Writes the contents of a
AwsProxyResponse to a HttpServletResponse . |
protected byte[] |
parseBodyAsBytes(com.amazonaws.serverless.proxy.model.AwsProxyResponse awsProxyResponse)
Returns the response's body bytes considering whether the body was Base64 encoded.
|
public DefaultServletToAwsProxyResponseAdapter()
public void handle(@NonNull javax.servlet.http.HttpServletRequest request, @NonNull com.amazonaws.serverless.proxy.model.AwsProxyResponse awsProxyResponse, @NonNull javax.servlet.http.HttpServletResponse response) throws java.io.IOException
ServletToAwsProxyResponseAdapter
AwsProxyResponse
to a HttpServletResponse
.handle
in interface ServletToAwsProxyResponseAdapter
request
- Servlet RequestawsProxyResponse
- The AWS proxy responseresponse
- The Servlet Responsejava.io.IOException
- can be thrown while writing the response@Nullable protected byte[] parseBodyAsBytes(com.amazonaws.serverless.proxy.model.AwsProxyResponse awsProxyResponse)
awsProxyResponse
- The responseprotected java.nio.charset.Charset getBodyCharset()