com.amazonaws.services.s3.model.lifecycle.LifecyclePrefixPredicate Java Examples

The following examples show how to use com.amazonaws.services.s3.model.lifecycle.LifecyclePrefixPredicate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BucketManager.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
private boolean isBucketPrefixPredicate(final LifecycleFilterPredicate filterPredicate, final String bucketPrefix) {
  if (filterPredicate instanceof LifecyclePrefixPredicate) {
    LifecyclePrefixPredicate prefixPredicate = (LifecyclePrefixPredicate) filterPredicate;
    return prefixPredicate.getPrefix().equals(bucketPrefix);
  }
  else {
    return false;
  }
}
 
Example #2
Source File: AmazonInitializer.java    From entrada with GNU General Public License v3.0 5 votes vote down vote up
private BucketLifecycleConfiguration.Rule createExpirationRule(String id, String prefix,
    int expiration) {
  return new BucketLifecycleConfiguration.Rule()
      .withId(id)
      .withFilter(new LifecycleFilter(new LifecyclePrefixPredicate(prefix)))
      .withExpirationInDays(expiration)
      .withStatus(BucketLifecycleConfiguration.ENABLED);
}