public final class RequestContent
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
RequestContent.Builder |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DATE_FORMAT
Deprecated.
|
static java.lang.String |
DATE_FORMAT_RFC1123 |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytesToSign(java.util.List<java.lang.String> headers,
java.nio.charset.Charset charset)
Returns the request content as a byte array for generating a signature.
|
byte[] |
getContent(java.util.List<java.lang.String> headers,
java.nio.charset.Charset charset)
Deprecated.
use
getBytesToSign(List, Charset) to include the Constants.HEADER_REQUEST_TARGET
prefix in signature content |
java.lang.String |
getContentString(java.util.List<java.lang.String> headers)
Deprecated.
use
getStringToSign(List) to include the Constants.HEADER_REQUEST_TARGET
prefix in signature content |
java.lang.String |
getDate() |
java.util.Date |
getDateGMT()
Returns the currently set date header value converted to a
Date object in the GMT time zone |
java.util.Calendar |
getDateTZ(java.util.TimeZone timeZone)
Returns the currently set date header value converted to a
Calendar in the specified timeZone, or in the
default timeZone if the parameter is null |
java.util.List<java.lang.String> |
getHeaderNames() |
java.util.List<java.lang.String> |
getHeaderValues(java.lang.String name) |
java.lang.String |
getRequestLine()
Deprecated.
|
java.lang.String |
getRequestTarget() |
java.lang.String |
getStringToSign(java.util.List<java.lang.String> headers)
Returns the request content as a String for generating a signature.
|
java.lang.String |
toString() |
protected static java.util.Date |
tryParseDate(java.lang.String date)
Sets the literal date header value.
|
@Deprecated public static final java.lang.String DATE_FORMAT
DATE_FORMAT_RFC1123)public static final java.lang.String DATE_FORMAT_RFC1123
@Deprecated
public byte[] getContent(java.util.List<java.lang.String> headers,
java.nio.charset.Charset charset)
getBytesToSign(List, Charset) to include the Constants.HEADER_REQUEST_TARGET
prefix in signature contentheaders - the list of headers to be included in the signed contentcharset - charset for decoding the contentgetContentString(java.util.List) encoded using the provided Charset@Deprecated public java.lang.String getContentString(java.util.List<java.lang.String> headers)
getStringToSign(List) to include the Constants.HEADER_REQUEST_TARGET
prefix in signature contentheaders - the list of headers to be included in the signed contentpublic java.lang.String getStringToSign(java.util.List<java.lang.String> headers)
headers - the list of headers to be included in the signed contentpublic byte[] getBytesToSign(java.util.List<java.lang.String> headers,
java.nio.charset.Charset charset)
headers - the list of headers to be included in the signed contentcharset - charset for decoding the contentgetStringToSign(List) encoded using the provided Charsetpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<java.lang.String> getHeaderNames()
RequestContent, in the order in which they were added, except
for request-target, which is listed first if present@Deprecated public java.lang.String getRequestLine()
public java.lang.String getRequestTarget()
public java.lang.String getDate()
public java.util.List<java.lang.String> getHeaderValues(java.lang.String name)
name - the name of the headerprotected static java.util.Date tryParseDate(java.lang.String date)
date - a date string conforming to DATE_FORMAT_RFC1123 or to the deprecated DATE_FORMATDATE_FORMAT_RFC1123 or to DATE_FORMATpublic java.util.Date getDateGMT()
Date object in the GMT time zoneDate object in GMT or null if header is not set or not validpublic java.util.Calendar getDateTZ(java.util.TimeZone timeZone)
Calendar in the specified timeZone, or in the
default timeZone if the parameter is nulltimeZone - some time zone or null to convert to the default time zoneCalendar in the specified time zone or in the default time zone if the timeZone parameter is nullCopyright © 2013-2017. All Rights Reserved.