Class S3Uri
java.lang.Object
software.amazon.awssdk.services.s3.S3Uri
- All Implemented Interfaces:
ToCopyableBuilder<S3Uri.Builder,
S3Uri>
@Immutable
public final class S3Uri
extends Object
implements ToCopyableBuilder<S3Uri.Builder,S3Uri>
Object that represents a parsed S3 URI. Can be used to easily retrieve the bucket, key, region, style, and query parameters
of the URI. Only path-style and virtual-hosted-style URI parsing is supported, including CLI-style URIs, e.g.,
"s3://bucket/key". AccessPoints and Outposts URI parsing is not supported. If you work with object keys and/or query
parameters with special characters, they must be URL-encoded, e.g., replace " " with "%20". If you work with
virtual-hosted-style URIs with bucket names that contain a dot, i.e., ".", the dot must not be URL-encoded. Encoded buckets,
keys, and query parameters will be returned decoded.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionbucket()
Returns the bucket specified in the URI.static S3Uri.Builder
builder()
boolean
Returns the value for the specified query parameter.Returns the list of values for a specified query parameter.int
hashCode()
boolean
Returns true if the URI is path-style, false if the URI is virtual-hosted style.key()
Returns the key specified in the URI.Returns a map of the query parameters specified in the URI.region()
Returns the region specified in the URI.Take this object and create a builder that contains all of the current property values of this object.toString()
uri()
Returns the original URI that was used to instantiate theS3Uri
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
builder
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<S3Uri.Builder,
S3Uri> - Returns:
- a builder for type T
-
uri
Returns the original URI that was used to instantiate theS3Uri
-
bucket
Returns the bucket specified in the URI. Returns an empty optional if no bucket is specified. -
key
Returns the key specified in the URI. Returns an empty optional if no key is specified. -
region
Returns the region specified in the URI. Returns an empty optional if no region is specified, i.e., global endpoint. -
isPathStyle
public boolean isPathStyle()Returns true if the URI is path-style, false if the URI is virtual-hosted style. -
rawQueryParameters
Returns a map of the query parameters specified in the URI. Returns an empty map if no queries are specified. -
firstMatchingRawQueryParameters
Returns the list of values for a specified query parameter. A empty list is returned if the URI does not contain the specified query parameter. -
firstMatchingRawQueryParameter
Returns the value for the specified query parameter. If there are multiple values for the query parameter, the first value is returned. An empty optional is returned if the URI does not contain the specified query parameter. -
toString
-
equals
-
hashCode
public int hashCode()
-