public abstract class BaseSasQueryParameters extends Object
String and appended to a URL directly
(though caution should be taken here in case there are existing query parameters, which might affect the appropriate
means of appending these query parameters). NOTE: Instances of this class are immutable to ensure thread safety.| Modifier and Type | Field and Description |
|---|---|
protected OffsetDateTime |
expiryTime |
protected String |
permissions |
protected SasProtocol |
protocol |
protected SasIpRange |
sasIpRange |
protected String |
signature |
protected OffsetDateTime |
startTime |
protected String |
version |
| Constructor and Description |
|---|
BaseSasQueryParameters(Map<String,String[]> queryParamsMap,
boolean removeSASParametersFromMap)
Creates a new
BaseSasQueryParameters object. |
BaseSasQueryParameters(String version,
SasProtocol protocol,
OffsetDateTime startTime,
OffsetDateTime expiryTime,
SasIpRange sasIpRange,
String permissions,
String signature)
Creates a new
BaseSasQueryParameters object. |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
encode()
Encodes all SAS query parameters into a string that can be appended to a URL.
|
protected String |
formatQueryParameterDate(OffsetDateTime dateTime)
Formats date time SAS query parameters.
|
OffsetDateTime |
getExpiryTime() |
String |
getPermissions() |
SasProtocol |
getProtocol() |
protected String |
getQueryParameter(Map<String,String[]> parameters,
String name,
boolean remove)
Helper method to get a query parameter
|
protected <T> T |
getQueryParameter(Map<String,String[]> parameters,
String name,
boolean remove,
Function<String,T> converter)
Helper method to get a query parameter
|
SasIpRange |
getSasIpRange() |
String |
getSignature() |
OffsetDateTime |
getStartTime() |
String |
getVersion() |
protected void |
tryAppendQueryParameter(StringBuilder sb,
String param,
Object value)
Shared helper method to append a SAS query parameter.
|
protected String version
protected SasProtocol protocol
protected OffsetDateTime startTime
protected OffsetDateTime expiryTime
protected SasIpRange sasIpRange
protected String permissions
protected String signature
public BaseSasQueryParameters(Map<String,String[]> queryParamsMap, boolean removeSASParametersFromMap)
BaseSasQueryParameters object.queryParamsMap - All query parameters for the request as key-value pairsremoveSASParametersFromMap - When true, the SAS query parameters will be removed from
queryParamsMappublic BaseSasQueryParameters(String version, SasProtocol protocol, OffsetDateTime startTime, OffsetDateTime expiryTime, SasIpRange sasIpRange, String permissions, String signature)
BaseSasQueryParameters object. These objects are only created internally by
SASSignatureValues classes.version - A String representing the storage version.protocol - A String representing the allowed HTTP protocol(s) or null.startTime - A java.util.Date representing the start time for this SAS token or null.expiryTime - A java.util.Date representing the expiry time for this SAS token.sasIpRange - A SasIpRange representing the range of valid IP addresses for this SAS token or
null.permissions - A String representing the storage permissions or null.signature - A String representing the signature for the SAS token.protected String getQueryParameter(Map<String,String[]> parameters, String name, boolean remove)
parameters - A Map of parameters to values to search.name - The name of parameter to find.remove - Whether or not to remove the parameter from the map.protected <T> T getQueryParameter(Map<String,String[]> parameters, String name, boolean remove, Function<String,T> converter)
T - The object type.parameters - A Map of parameters to values to search.name - The name of parameter to find.remove - Whether or not to remove the parameter from the map.converter - Function that transforms the value to a String.public String getVersion()
public SasProtocol getProtocol()
null. Please refer to SasProtocol for more details.public OffsetDateTime getStartTime()
null.public OffsetDateTime getExpiryTime()
public SasIpRange getSasIpRange()
SasIpRangepublic String getPermissions()
public String getSignature()
protected void tryAppendQueryParameter(StringBuilder sb, String param, Object value)
sb - The StringBuilder to append to.param - The String parameter to append.value - The value of the parameter to append.protected String formatQueryParameterDate(OffsetDateTime dateTime)
dateTime - The SAS date time.public abstract String encode()
String representing all SAS query parameters.Copyright © 2019 Microsoft Corporation. All rights reserved.