Class BucketLifecycleConfiguration.Rule

    • Constructor Detail

      • Rule

        public Rule()
    • Method Detail

      • setId

        public void setId​(String id)
        Sets the ID of this rule. Rules must be less than 255 alphanumeric characters, and must be unique for a bucket. If you do not assign an ID, one will be generated.
      • setPrefix

        public void setPrefix​(String prefix)
        Sets the key prefix for which this rule will apply.
      • setExpirationInDays

        public void setExpirationInDays​(int expirationInDays)
        Sets the time, in days, between when an object is uploaded to the bucket and when it expires.
      • setNoncurrentVersionExpirationInDays

        public void setNoncurrentVersionExpirationInDays​(int value)
        Sets the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire.
      • getId

        public String getId()
        Returns the ID of this rule.
      • getPrefix

        public String getPrefix()
        Returns the key prefix for which this rule will apply.
      • getExpirationInDays

        public int getExpirationInDays()
        Returns the time in days from an object's creation to its expiration.
      • withExpirationInDays

        public BucketLifecycleConfiguration.Rule withExpirationInDays​(int expirationInDays)
        Sets the time, in days, between when an object is uploaded to the bucket and when it expires, and returns a reference to this object for method chaining.
        See Also:
        setExpirationInDays(int)
      • getNoncurrentVersionExpirationInDays

        public int getNoncurrentVersionExpirationInDays()
        Returns the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire.
      • withNoncurrentVersionExpirationInDays

        public BucketLifecycleConfiguration.Rule withNoncurrentVersionExpirationInDays​(int value)
        Sets the time, in days, between when a new version of the object is uploaded to the bucket and when older versions of the object expire, and returns a reference to this object for method chaining.
      • setExpirationDate

        public void setExpirationDate​(Date expirationDate)
        Sets the expiration date of the object.
      • getExpirationDate

        public Date getExpirationDate()
        Returns the expiration date of the object.
      • withExpirationDate

        public BucketLifecycleConfiguration.Rule withExpirationDate​(Date expirationDate)
        Sets the expiration date of the object and returns a reference to this object(Rule) for method chaining.
      • setTransition

        @Deprecated
        public void setTransition​(BucketLifecycleConfiguration.Transition transition)
        Deprecated.
        Sets the transition describing how this object will move between different storage classes in Amazon S3. Bucket Life cycle configuration can now accept multiple transitions in a rule. Note : This method overwrites all the existing transitions with given transition. @Deprecated in favor of setTransitions(List)
      • getTransition

        @Deprecated
        public BucketLifecycleConfiguration.Transition getTransition()
        Deprecated.
        Returns the transition associated with the rule. If there are more than one transition associated with a given rule, this method returns the last transition rule.
      • setNoncurrentVersionTransition

        @Deprecated
        public void setNoncurrentVersionTransition​(BucketLifecycleConfiguration.NoncurrentVersionTransition nonCurrentVersionTransition)
        Deprecated.
        Sets the transition describing how non-current versions of objects will move between different storage classes in Amazon S3. Bucket Life cycle configuration can now accept multiple non current transitions in a rule. Note: This method overwrites all the existing transitions with given transition. @Deprecated in favor of setNoncurrentVersionTransitions(List)
      • setAbortIncompleteMultipartUpload

        public void setAbortIncompleteMultipartUpload​(AbortIncompleteMultipartUpload abortIncompleteMultipartUpload)
      • isExpiredObjectDeleteMarker

        public boolean isExpiredObjectDeleteMarker()
        Returns whether the current expiration policy for the object is set to remove objects when only a delete marker is left

        If set to true the lifecycle policy will delete the current version of an object if and only if the current version is a expired object delete marker. This option only makes sense to use for versioned buckets and cannot be used in conjunction with expirationInDays or expirationDate. Note that the current version can only be removed if all non-current versions have been removed (either through a non-current version expiration policy or being explicitly deleted)

        Returns:
        True if this lifecycle's configuration is configured to delete the current version of an object if it's the only version left and it's a delete marker. False otherwise
      • setExpiredObjectDeleteMarker

        public void setExpiredObjectDeleteMarker​(boolean expiredObjectDeleteMarker)
        Sets the value of the ExpiredObjectDeleteMarkers attribute.
        Parameters:
        expiredObjectDeleteMarker - True to allow the current expiration policy to remove the current version of the object if it's the only version left and it's a delete marker. False has no effect on the current expiration policy