/** * @deprecated use {@link AmazonS3ClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)} */ @Override @Deprecated public synchronized void setEndpoint(String endpoint) { if (ServiceUtils.isS3AccelerateEndpoint(endpoint)) { throw new IllegalStateException("To enable accelerate mode, please use AmazonS3ClientBuilder.withAccelerateModeEnabled(true)"); } else { super.setEndpoint(endpoint); /* * Extract the region string from the endpoint if it's not known to be a * global S3 endpoint. */ if (!ServiceUtils.isS3USStandardEndpoint(endpoint)) { clientRegion = AwsHostNameUtils.parseRegionName(this.endpoint.getHost(), S3_SERVICE_NAME); } } }
@Override public Signer getSigner(SignerProviderContext signerProviderContext) { URI uri = signerProviderContext.getUri(); // Return the default signer if no URI is passed, the client is configured with region override, // or if we are hitting an accelerate endpoint. if (uri == null || ServiceUtils.isS3AccelerateEndpoint(uri.getHost()) || isSignerRegionOverrideSet()) { return signer; } if (signer instanceof RegionAwareSigner) { // Parse region name from the host component of the URL and // assign it to the signer RegionAwareSigner regionSigner = (RegionAwareSigner) signer; try { regionSigner.setRegionName(AwsHostNameUtils.parseRegionName( uri.getHost(), "s3")); } catch (RuntimeException e) { log.warn("Failed to parse the endpoint " + uri + ", and skip re-assigning the signer region", e); } } return signer; }
/** * @deprecated use {@link AmazonS3ClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)} */ @Override @Deprecated public synchronized void setEndpoint(String endpoint) { if (ServiceUtils.isS3AccelerateEndpoint(endpoint)) { throw new IllegalStateException("To enable accelerate mode, please use AmazonS3ClientBuilder.withAccelerateModeEnabled(true)"); } else { super.setEndpoint(endpoint); /* * Extract the region string from the endpoint if it's not known to be a * global S3 endpoint. */ if (!ServiceUtils.isS3USStandardEndpoint(endpoint)) { clientRegion = AwsHostNameUtils.parseRegionName(this.endpoint.getHost(), S3_SERVICE_NAME); } } }
@Override public Signer getSigner(SignerProviderContext signerProviderContext) { URI uri = signerProviderContext.getUri(); // Return the default signer if no URI is passed, the client is configured with region override, // or if we are hitting an accelerate endpoint. if (uri == null || ServiceUtils.isS3AccelerateEndpoint(uri.getHost()) || isSignerRegionOverrideSet()) { return signer; } if (signer instanceof RegionAwareSigner) { // Parse region name from the host component of the URL and // assign it to the signer RegionAwareSigner regionSigner = (RegionAwareSigner) signer; try { regionSigner.setRegionName(AwsHostNameUtils.parseRegionName( uri.getHost(), "s3")); } catch (RuntimeException e) { log.warn("Failed to parse the endpoint " + uri + ", and skip re-assigning the signer region", e); } } return signer; }