Package com.amazonaws.services.s3
Class AmazonS3URI
- java.lang.Object
-
- com.amazonaws.services.s3.AmazonS3URI
-
public class AmazonS3URI extends Object
A URI wrapper that can parse out information about an S3 URI.
-
-
Constructor Summary
Constructors Constructor Description AmazonS3URI(String str)
Creates a new AmazonS3URI by parsing the given string.AmazonS3URI(String str, boolean urlEncode)
Creates a new AmazonS3URI by parsing the given string.AmazonS3URI(URI uri)
Creates a new AmazonS3URI by wrapping the givenURI
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getBucket()
String
getKey()
String
getRegion()
URI
getURI()
String
getVersionId()
int
hashCode()
boolean
isPathStyle()
String
toString()
-
-
-
Constructor Detail
-
AmazonS3URI
public AmazonS3URI(String str)
Creates a new AmazonS3URI by parsing the given string. String will be URL encoded before generating the URI.- Parameters:
str
- the URI to parse.
-
AmazonS3URI
public AmazonS3URI(String str, boolean urlEncode)
Creates a new AmazonS3URI by parsing the given string. String will optionally be URL encoded before generating the URI. URL encoding is recommended if you work with bucket names or object keys with special characters. This can be disabled if you pre-encode URI strings before passing them to this class.- Parameters:
str
- the URI to parse.urlEncode
- true if string should be URL encoded
-
AmazonS3URI
public AmazonS3URI(URI uri)
Creates a new AmazonS3URI by wrapping the givenURI
.- Parameters:
uri
- the URI to wrap
-
-
Method Detail
-
getURI
public URI getURI()
- Returns:
- the S3 URI being parsed
-
isPathStyle
public boolean isPathStyle()
- Returns:
- true if the URI contains the bucket in the path, false if it contains the bucket in the authority
-
getBucket
public String getBucket()
- Returns:
- the bucket name parsed from the URI (or null if no bucket specified)
-
getKey
public String getKey()
- Returns:
- the key parsed from the URI (or null if no key specified)
-
getVersionId
public String getVersionId()
- Returns:
- the version id parsed from the URI (or null if no version specified)
-
getRegion
public String getRegion()
- Returns:
- the region parsed from the URI (or null if no region specified)
-
-