Java 类com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject 实例源码

项目:ibm-cos-sdk-java    文件:XmlResponsesSaxParser.java   
@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();
        }
    }
}
项目:herd    文件:MockS3OperationsImpl.java   
@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);
}
项目:aws-java-sdk-stubs    文件:AmazonS3Stub.java   
/**
 * {@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);
}
项目:ibm-cos-sdk-java    文件:MultiObjectDeleteException.java   
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);
}
项目:ibm-cos-sdk-java    文件:DeleteObjectsResponse.java   
public DeleteObjectsResponse() {
    this(new ArrayList<DeletedObject>(), new ArrayList<DeleteError>());
}
项目:ibm-cos-sdk-java    文件:DeleteObjectsResponse.java   
public DeleteObjectsResponse(List<DeletedObject> deletedObjects, List<DeleteError> errors) {
    this.deletedObjects = deletedObjects;
    this.errors = errors;
}
项目:ibm-cos-sdk-java    文件:DeleteObjectsResponse.java   
public List<DeletedObject> getDeletedObjects() {
    return deletedObjects;
}
项目:ibm-cos-sdk-java    文件:DeleteObjectsResponse.java   
public void setDeletedObjects(List<DeletedObject> deletedObjects) {
    this.deletedObjects = deletedObjects;
}
项目:ibm-cos-sdk-java    文件:MultiObjectDeleteException.java   
/**
 * 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;
}