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 Details

    • 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 given URI.
      Parameters:
      uri - the URI to wrap
  • Method Details

    • 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)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object