Class S3Bucket


public class S3Bucket extends StorageBucket
Represents an S3 bucket.
Author:
James Murty
  • Field Details

  • Constructor Details

    • S3Bucket

      public S3Bucket()
      Create a bucket without any name or location specified
    • S3Bucket

      public S3Bucket(String name)
      Create a bucket with a name. All buckets in S3 share a single namespace, so choose a unique name for your bucket.
      Parameters:
      name - the name for the bucket
    • S3Bucket

      public S3Bucket(String name, String location)
      Create a bucket with a name and a location. All buckets in S3 share a single namespace, so choose a unique name for your bucket.
      Parameters:
      name - the name for the bucket
      location - A string representing the location. Legal values include LOCATION_US and null (which are equivalent), or LOCATION_EUROPE.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class StorageBucket
    • setLocation

      public void setLocation(String location)
      Set's the bucket's location. This method should only be used internally by JetS3t methods that retrieve information directly from S3.
      Parameters:
      location - A string representing the location. Legal values include LOCATION_US and null (which are equivalent), or LOCATION_EUROPE.
    • isLocationKnown

      public boolean isLocationKnown()
      Returns:
      true if this object knows the bucket's location, false otherwise.
    • getLocation

      public String getLocation()
      Returns:
      the bucket's location represented as a string. "EU" denotes a bucket located in Europe, while null denotes a bucket located in the US.
    • setRequesterPays

      public void setRequesterPays(boolean requesterPays)
      Set's the bucket's Requester Pays Configuration setting. This method should only be used internally by JetS3t methods that retrieve information directly from S3.
      Parameters:
      requesterPays - true if the bucket is configured for Requester Pays, false if it is configured for Owner pays.
    • isRequesterPaysKnown

      public boolean isRequesterPaysKnown()
      Returns:
      true if this bucket object knows its Requester Pays status, false otherwise.
    • isRequesterPays

      public boolean isRequesterPays()
      Return the Requester Pays status of this bucket, if it is known.

      WARNING: Before you use this method, always check with the isRequesterPaysKnown method to ensure that the Requester Pays status has been set, otherwise the result of this method is meaningless.

      Returns:
      true if the bucket is configured for Requester Pays, false if it is configured for Owner pays or the Request Pays configuration status is unknown.
    • cast

      public static S3Bucket[] cast(StorageBucket[] buckets)