Example usage for com.amazonaws SignableRequest setContent

List of usage examples for com.amazonaws SignableRequest setContent

Introduction

In this page you can find the example usage for com.amazonaws SignableRequest setContent.

Prototype

void setContent(InputStream content);

Source Link

Document

Sets the optional stream containing the payload data to include for this request.

Usage

From source file:com.ibm.og.s3.v4.AWSS3V4Signer.java

License:Open Source License

/**
 * If necessary, creates a chunk-encoding wrapper on the request payload.
 *///  w  ww .j  a  v  a  2s  . c om
@Override
protected void processRequestPayload(final SignableRequest<?> request, final byte[] signature,
        final byte[] signingKey, final AWS4SignerRequestParams signerRequestParams) {
    if (useChunkEncoding(request)) {
        final AwsChunkedEncodingInputStream chunkEncodededStream = new AwsChunkedEncodingInputStream(
                request.getContent(), signingKey, signerRequestParams.getFormattedSigningDateTime(),
                signerRequestParams.getScope(), BinaryUtils.toHex(signature), this, this.digestCache);
        request.setContent(chunkEncodededStream);
    }
}