Class AmazonS3URI


  • public class AmazonS3URI
    extends Object
    A URI wrapper that can parse out information about an S3 URI.
    • 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 given URI.
        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)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object