项目:nexus-blobstore-s3
文件:S3BlobStore.java
boolean isExpirationLifecycleConfigurationPresent(BucketLifecycleConfiguration lifecycleConfiguration) {
return lifecycleConfiguration != null &&
lifecycleConfiguration.getRules() != null &&
lifecycleConfiguration.getRules().stream()
.filter(r -> r.getExpirationInDays() == getConfiguredExpirationInDays())
.filter(r -> {
LifecycleFilterPredicate predicate = r.getFilter().getPredicate();
if (predicate instanceof LifecycleTagPredicate) {
LifecycleTagPredicate tagPredicate = (LifecycleTagPredicate) predicate;
return DELETED_TAG.equals(tagPredicate.getTag());
}
return false;
})
.findAny().isPresent();
}
@Override
public void visit(LifecycleAndOperator lifecycleAndOperator) {
xml.start("And");
for (LifecycleFilterPredicate predicate : lifecycleAndOperator.getoperands()) {
predicate.accept(this);
}
xml.end(); // </And>
}
项目: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
boolean isExpirationLifecycleConfigurationPresent(BucketLifecycleConfiguration lifecycleConfiguration) {
return lifecycleConfiguration != null &&
lifecycleConfiguration.getRules() != null &&
lifecycleConfiguration.getRules().stream()
.filter(r -> r.getExpirationInDays() == getConfiguredExpirationInDays())
.anyMatch(r -> {
LifecycleFilterPredicate predicate = r.getFilter().getPredicate();
if (predicate instanceof LifecycleTagPredicate) {
LifecycleTagPredicate tagPredicate = (LifecycleTagPredicate) predicate;
return DELETED_TAG.equals(tagPredicate.getTag());
}
return false;
});
}
private void writeLifecycleFilterPredicate(XmlWriter xml,LifecycleFilterPredicate predicate) {
if (predicate == null) {
return;
}
predicate.accept(new LifecyclePredicateVisitorImpl(xml));
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。