本文整理汇总了Java中com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject类的典型用法代码示例。如果您正苦于以下问题:Java DeletedObject类的具体用法?Java DeletedObject怎么用?Java DeletedObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DeletedObject类属于com.amazonaws.services.s3.model.DeleteObjectsResult包,在下文中一共展示了DeletedObject类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doStartElement
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
@Override
protected void doStartElement(
String uri,
String name,
String qName,
Attributes attrs) {
if (in("DeleteResult")) {
if (name.equals("Deleted")) {
currentDeletedObject = new DeletedObject();
} else if (name.equals("Error")) {
currentError = new DeleteError();
}
}
}
示例2: deleteObjects
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
@Override
public DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest, AmazonS3 s3Client)
{
LOGGER.debug("deleteObjects(): deleteObjectRequest.getBucketName() = " + deleteObjectsRequest.getBucketName() + ", deleteObjectRequest.getKeys() = " +
deleteObjectsRequest.getKeys());
List<DeletedObject> deletedObjects = new ArrayList<>();
MockS3Bucket mockS3Bucket = mockS3Buckets.get(deleteObjectsRequest.getBucketName());
for (KeyVersion keyVersion : deleteObjectsRequest.getKeys())
{
String s3ObjectKey = keyVersion.getKey();
String s3ObjectVersion = keyVersion.getVersion();
String s3ObjectKeyVersion = s3ObjectKey + (s3ObjectVersion != null ? s3ObjectVersion : "");
mockS3Bucket.getObjects().remove(s3ObjectKey);
if (mockS3Bucket.getVersions().remove(s3ObjectKeyVersion) != null)
{
DeletedObject deletedObject = new DeletedObject();
deletedObject.setKey(s3ObjectKey);
deletedObject.setVersionId(s3ObjectVersion);
deletedObjects.add(deletedObject);
}
}
return new DeleteObjectsResult(deletedObjects);
}
示例3: deleteObjects
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* The stub does not currently support versions so this stub only supports full deletes of the objects. Passing in a
* list of KeyVersion specs to be deleted will completely delete those objects from the stubs.
*
* @see com.amazonaws.services.s3.AmazonS3#deleteObjects(com.amazonaws.services.s3.model.DeleteObjectsRequest)
*/
@Override
public DeleteObjectsResult deleteObjects(final DeleteObjectsRequest deleteObjectsRequest) {
final List<DeleteObjectsResult.DeletedObject> deletedObjects = new ArrayList<DeletedObject>();
final BucketInfo bucket = getBucketInfo(deleteObjectsRequest.getBucketName());
for (final KeyVersion key : deleteObjectsRequest.getKeys()) {
final boolean found = bucket.deleteObject(key.getKey());
if (!deleteObjectsRequest.getQuiet() && found) {
final DeleteObjectsResult.DeletedObject result = new DeleteObjectsResult.DeletedObject();
result.setKey(key.getKey());
deletedObjects.add(result);
}
}
return new DeleteObjectsResult(deletedObjects);
}
示例4: MultiObjectDeleteException
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public MultiObjectDeleteException(Collection<DeleteError> errors, Collection<DeletedObject> deletedObjects) {
super("One or more objects could not be deleted");
this.deletedObjects.addAll(deletedObjects);
this.errors.addAll(errors);
}
示例5: DeleteObjectsResponse
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public DeleteObjectsResponse() {
this(new ArrayList<DeletedObject>(), new ArrayList<DeleteError>());
}
示例6: getDeletedObjects
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public List<DeletedObject> getDeletedObjects() {
return deletedObjects;
}
示例7: setDeletedObjects
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public void setDeletedObjects(List<DeletedObject> deletedObjects) {
this.deletedObjects = deletedObjects;
}
示例8: getDeletedObjects
import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
/**
* Returns the list of successfully deleted objects from this request. If
* {@link DeleteObjectsRequest#getQuiet()} is true, only error responses
* will be returned from s3.
*/
public List<DeletedObject> getDeletedObjects() {
return deletedObjects;
}