public final class RequestContent extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
RequestContent.Builder |
Modifier and Type | Field and Description |
---|---|
static String |
DATE_FORMAT
Deprecated.
|
static String |
DATE_FORMAT_RFC1123 |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytesToSign(List<String> headers,
Charset charset)
Returns the request content as a byte array for generating a signature.
|
byte[] |
getContent(List<String> headers,
Charset charset)
Deprecated.
use
getBytesToSign(List, Charset) to include the Constants.HEADER_REQUEST_TARGET
prefix in signature content |
String |
getContentString(List<String> headers)
Deprecated.
use
getStringToSign(List) to include the Constants.HEADER_REQUEST_TARGET
prefix in signature content |
String |
getDate() |
Date |
getDateGMT()
Returns the currently set date header value converted to a
Date object in the GMT time zone |
Calendar |
getDateTZ(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 |
List<String> |
getHeaderNames() |
List<String> |
getHeaderValues(String name) |
String |
getRequestLine()
Deprecated.
|
String |
getRequestTarget() |
String |
getStringToSign(List<String> headers)
Returns the request content as a String for generating a signature.
|
String |
toString() |
protected static Date |
tryParseDate(String date)
Sets the literal date header value.
|
@Deprecated public static final String DATE_FORMAT
DATE_FORMAT_RFC1123
)public static final String DATE_FORMAT_RFC1123
@Deprecated public byte[] getContent(List<String> headers, 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 String getContentString(List<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 String getStringToSign(List<String> headers)
headers
- the list of headers to be included in the signed contentpublic byte[] getBytesToSign(List<String> headers, Charset charset)
headers
- the list of headers to be included in the signed contentcharset
- charset for decoding the contentgetStringToSign(List)
encoded using the provided Charset
public List<String> getHeaderNames()
RequestContent
, in the order in which they were added, except
for request-target, which is listed first if present@Deprecated public String getRequestLine()
public String getRequestTarget()
public String getDate()
public List<String> getHeaderValues(String name)
name
- the name of the headerprotected static Date tryParseDate(String date)
date
- a date string conforming to DATE_FORMAT_RFC1123
or to the deprecated DATE_FORMAT
DATE_FORMAT_RFC1123
or to DATE_FORMAT
public Date getDateGMT()
Date
object in the GMT time zoneDate
object in GMT or null if header is not set or not validpublic Calendar getDateTZ(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.