public class S3RequestEndpointResolver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
bucketName |
private ServiceEndpointBuilder |
endpointBuilder |
private boolean |
isPathStyleAccess |
private java.lang.String |
key |
Constructor and Description |
---|
S3RequestEndpointResolver(ServiceEndpointBuilder endpointBuilder,
boolean isPathStyleAccess,
java.lang.String bucketName,
java.lang.String key) |
Modifier and Type | Method and Description |
---|---|
private static java.net.URI |
convertToVirtualHostEndpoint(java.net.URI endpoint,
java.lang.String bucketName)
Converts the current endpoint set for this client into virtual addressing style, by placing
the name of the specified bucket before the S3 service endpoint.
|
java.lang.String |
getBucketName() |
private java.lang.String |
getHostStyleResourcePath() |
private java.lang.String |
getPathStyleResourcePath() |
(package private) static boolean |
isValidIpV4Address(java.lang.String ipAddr) |
void |
resolveRequestEndpoint(Request<?> request)
Set the request's endpoint and resource path with the same region it was originally
configured for
|
void |
resolveRequestEndpoint(Request<?> request,
java.lang.String regionString)
Set the request's endpoint and resource path with the new region provided
|
private boolean |
shouldUseVirtualAddressing(java.net.URI endpoint) |
private final ServiceEndpointBuilder endpointBuilder
private final boolean isPathStyleAccess
private final java.lang.String bucketName
private final java.lang.String key
public S3RequestEndpointResolver(ServiceEndpointBuilder endpointBuilder, boolean isPathStyleAccess, java.lang.String bucketName, java.lang.String key)
static boolean isValidIpV4Address(java.lang.String ipAddr)
private static java.net.URI convertToVirtualHostEndpoint(java.net.URI endpoint, java.lang.String bucketName)
bucketName
- The name of the bucket to use in the virtual addressing style of the returned URI.public java.lang.String getBucketName()
public void resolveRequestEndpoint(Request<?> request)
request
- Request to set endpoint forpublic void resolveRequestEndpoint(Request<?> request, java.lang.String regionString)
request
- Request to set endpoint forregionString
- New region to determine endpoint to hitprivate boolean shouldUseVirtualAddressing(java.net.URI endpoint)
private java.lang.String getHostStyleResourcePath()
private java.lang.String getPathStyleResourcePath()