public class AmazonS3URI
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
bucket |
private static java.util.regex.Pattern |
ENDPOINT_PATTERN |
private boolean |
isPathStyle |
private java.lang.String |
key |
private java.lang.String |
region |
private java.net.URI |
uri |
private static java.util.regex.Pattern |
VERSION_ID_PATTERN |
private java.lang.String |
versionId |
Modifier | Constructor and Description |
---|---|
|
AmazonS3URI(java.lang.String str)
Creates a new AmazonS3URI by parsing the given string.
|
|
AmazonS3URI(java.lang.String str,
boolean urlEncode)
Creates a new AmazonS3URI by parsing the given string.
|
|
AmazonS3URI(java.net.URI uri)
Creates a new AmazonS3URI by wrapping the given
URI . |
private |
AmazonS3URI(java.net.URI uri,
boolean urlEncode) |
Modifier and Type | Method and Description |
---|---|
private static void |
appendDecoded(java.lang.StringBuilder builder,
java.lang.String str,
int index)
Decodes the percent-encoded character at the given index in the string
and appends the decoded value to the given
StringBuilder . |
private static java.lang.String |
decode(java.lang.String str)
Percent-decodes the given string, with a fast path for strings that
are not percent-encoded.
|
private static java.lang.String |
decode(java.lang.String str,
int firstPercent)
Percent-decodes the given string.
|
boolean |
equals(java.lang.Object o) |
private static int |
fromHex(char c)
Converts a hex character (0-9A-Fa-f) into its corresponding quad value.
|
java.lang.String |
getBucket() |
java.lang.String |
getKey() |
java.lang.String |
getRegion() |
java.net.URI |
getURI() |
java.lang.String |
getVersionId() |
int |
hashCode() |
boolean |
isPathStyle() |
private static java.lang.String |
parseVersionId(java.lang.String query)
Attempts to parse a versionId parameter from the query
string.
|
private static java.lang.String |
preprocessUrlStr(java.lang.String str,
boolean encode)
URL encodes the given string.
|
java.lang.String |
toString() |
private static final java.util.regex.Pattern ENDPOINT_PATTERN
private static final java.util.regex.Pattern VERSION_ID_PATTERN
private final java.net.URI uri
private final boolean isPathStyle
private final java.lang.String bucket
private final java.lang.String key
private final java.lang.String versionId
private final java.lang.String region
public AmazonS3URI(java.lang.String str)
str
- the URI to parse.public AmazonS3URI(java.lang.String str, boolean urlEncode)
str
- the URI to parse.urlEncode
- true if string should be URL encodedpublic AmazonS3URI(java.net.URI uri)
URI
.uri
- the URI to wrapprivate AmazonS3URI(java.net.URI uri, boolean urlEncode)
private static java.lang.String parseVersionId(java.lang.String query)
query
- the query string to parse (possibly null)public java.net.URI getURI()
public boolean isPathStyle()
public java.lang.String getBucket()
public java.lang.String getKey()
public java.lang.String getVersionId()
public java.lang.String getRegion()
public java.lang.String toString()
toString
in class java.lang.Object
private static java.lang.String preprocessUrlStr(java.lang.String str, boolean encode)
str
- the string to encodeprivate static java.lang.String decode(java.lang.String str)
str
- the string to decodeprivate static java.lang.String decode(java.lang.String str, int firstPercent)
str
- the string to decodefirstPercent
- the index of the first '%' character in the stringprivate static void appendDecoded(java.lang.StringBuilder builder, java.lang.String str, int index)
StringBuilder
.builder
- the string builder to append tostr
- the string being decodedindex
- the index of the '%' character in the stringprivate static int fromHex(char c)
c
- the hex characterpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object