Class AmazonS3Util

java.lang.Object
com.northconcepts.datapipeline.amazons3.AmazonS3Util

public class AmazonS3Util extends Object
Static helpers that write and read object expiration rules in an S3 bucket's lifecycle configuration through an S3ControlClient.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Integer
    getExpirationDays(S3ControlClient controlClient, String accountId, String bucket, String pathPrefix)
    Returns the expiration days of the first enabled lifecycle rule on bucket that has an expiration and whose filter prefixes, if any, all equal pathPrefix, or null if no rule matches.
    static PutBucketLifecycleConfigurationResponse
    putExpirationDays(S3ControlClient controlClient, String accountId, String bucket, String pathPrefix, int daysToLive)
    Puts a lifecycle configuration on bucket with a single enabled rule that expires objects whose keys start with pathPrefix after daysToLive days.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AmazonS3Util

      public AmazonS3Util()
  • Method Details

    • putExpirationDays

      public static PutBucketLifecycleConfigurationResponse putExpirationDays(S3ControlClient controlClient, String accountId, String bucket, String pathPrefix, int daysToLive)
      Puts a lifecycle configuration on bucket with a single enabled rule that expires objects whose keys start with pathPrefix after daysToLive days.
    • getExpirationDays

      public static Integer getExpirationDays(S3ControlClient controlClient, String accountId, String bucket, String pathPrefix)
      Returns the expiration days of the first enabled lifecycle rule on bucket that has an expiration and whose filter prefixes, if any, all equal pathPrefix, or null if no rule matches.