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

The following examples show how to use com.amazonaws.services.s3.model.lifecycle.LifecycleFilter. 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: S3BlobStore.java    From nexus-blobstore-s3 with Eclipse Public License 1.0 5 votes vote down vote up
BucketLifecycleConfiguration makeLifecycleConfiguration(BucketLifecycleConfiguration existing, int expirationInDays) {
  BucketLifecycleConfiguration.Rule rule = new BucketLifecycleConfiguration.Rule()
      .withId(LIFECYCLE_EXPIRATION_RULE_ID)
      .withFilter(new LifecycleFilter(
          new LifecycleTagPredicate(DELETED_TAG)))
      .withExpirationInDays(expirationInDays)
      .withStatus(BucketLifecycleConfiguration.ENABLED.toString());

  if (existing != null) {
    existing.getRules().add(rule);
    return existing;
  } else {
    return new BucketLifecycleConfiguration().withRules(rule);
  }
}
 
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);
}
 
Example #3
Source File: XmlResponsesSaxParser.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected void doStartElement(
    String uri,
    String name,
    String qName,
    Attributes attrs) {

    if (in("LifecycleConfiguration")) {
        if (name.equals("Rule")) {
            currentRule = new Rule();
        }
    } else if (in("LifecycleConfiguration", "Rule")) {
        if (name.equals("Transition")) {
            currentTransition = new Transition();
        } else if (name.equals("NoncurrentVersionTransition")) {
            currentNcvTransition = new NoncurrentVersionTransition();
        } else if (name.equals("AbortIncompleteMultipartUpload")) {
            abortIncompleteMultipartUpload = new
                AbortIncompleteMultipartUpload();
        } else if (name.equals("Filter")) {
            currentFilter = new LifecycleFilter();
        }
    } else if (in("LifecycleConfiguration", "Rule", "Filter")) {
        if (name.equals("And")) {
            andOperandsList = new ArrayList<LifecycleFilterPredicate>();
        }
    }
}