当前位置: 首页>>代码示例>>Java>>正文


Java DeletedObject类代码示例

本文整理汇总了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();
        }
    }
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:16,代码来源:XmlResponsesSaxParser.java

示例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);
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:30,代码来源:MockS3OperationsImpl.java

示例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);
}
 
开发者ID:bizo,项目名称:aws-java-sdk-stubs,代码行数:23,代码来源:AmazonS3Stub.java

示例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);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:6,代码来源:MultiObjectDeleteException.java

示例5: DeleteObjectsResponse

import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public DeleteObjectsResponse() {
    this(new ArrayList<DeletedObject>(), new ArrayList<DeleteError>());
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:DeleteObjectsResponse.java

示例6: getDeletedObjects

import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public List<DeletedObject> getDeletedObjects() {
    return deletedObjects;
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:DeleteObjectsResponse.java

示例7: setDeletedObjects

import com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject; //导入依赖的package包/类
public void setDeletedObjects(List<DeletedObject> deletedObjects) {
    this.deletedObjects = deletedObjects;
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:4,代码来源:DeleteObjectsResponse.java

示例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;
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:9,代码来源:MultiObjectDeleteException.java


注:本文中的com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。