Java 类com.amazonaws.services.s3.model.lifecycle.LifecycleFilter 实例源码

项目:nexus-blobstore-s3    文件:S3BlobStore.java   
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);
  }
}
项目:ibm-cos-sdk-java    文件:BucketConfigurationXmlFactory.java   
private void writeLifecycleFilter(XmlWriter xml, LifecycleFilter filter) {
    if (filter == null) {
        return;
    }

    xml.start("Filter");
    writeLifecycleFilterPredicate(xml, filter.getPredicate());
    xml.end();
}
项目:ibm-cos-sdk-java    文件:XmlResponsesSaxParser.java   
@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>();
        }
    }
}
项目:nexus-public    文件:S3BlobStore.java   
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);

  if (existing != null) {
    existing.getRules().add(rule);
    return existing;
  } else {
    return new BucketLifecycleConfiguration().withRules(rule);
  }
}
项目:ibm-cos-sdk-java    文件:BucketLifecycleConfiguration.java   
/**
 * Returns a {@link LifecycleFilter} that is used to identify objects that a Lifecycle Rule applies to.
 */
public LifecycleFilter getFilter() {
    return filter;
}
项目:ibm-cos-sdk-java    文件:BucketLifecycleConfiguration.java   
/**
 * Sets the {@link LifecycleFilter} that is used to identify objects that a Lifecycle Rule applies to.
 * A rule cannot have both {@link LifecycleFilter} and the deprecated {@link #prefix}.
 *
 * @param filter {@link LifecycleFilter}
 */
public void setFilter(LifecycleFilter filter) {
    this.filter = filter;
}
项目:ibm-cos-sdk-java    文件:BucketLifecycleConfiguration.java   
/**
 * Fluent method to set the {@link LifecycleFilter} that is used to identify objects
 * that a Lifecycle Rule applies to. A rule cannot have both {@link LifecycleFilter}
 * and the deprecated {@link #prefix}.
 *
 * @param filter {@link LifecycleFilter}
 * @return This object for method chaining.
 */
public Rule withFilter(LifecycleFilter filter) {
    setFilter(filter);
    return this;
}