Example usage for com.amazonaws.services.s3.model ListMultipartUploadsRequest getUploadIdMarker

List of usage examples for com.amazonaws.services.s3.model ListMultipartUploadsRequest getUploadIdMarker

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model ListMultipartUploadsRequest getUploadIdMarker.

Prototype

public String getUploadIdMarker() 

Source Link

Document

Returns the optional upload ID marker indicating where in the results to begin listing.

Usage

From source file:org.finra.dm.dao.impl.MockS3OperationsImpl.java

License:Apache License

/**
 * <p>//w ww  .  java2 s  . c o  m
 * Returns a mock list of multipart uploads. Since a multipart upload in progress does not exist when in-memory, this method simply returns a preconfigured
 * list.
 * </p>
 * <p>
 * Returns a mock {@link MultipartUploadListing} based on the parameters and hints provided. By default returns a mock listing as defiend by
 * {@link #getMultipartUploadListing()}.
 * </p>
 * <p>
 * This operation takes the following hints when suffixed in listMultipartUploadsRequest.bucketName:
 * <dl>
 * <p/>
 * <dt>MOCK_S3_BUCKET_NAME_SERVICE_EXCEPTION</dt>
 * <dd>Throws a AmazonServiceException</dd>
 * <p/>
 * <dt>MOCK_S3_BUCKET_NAME_TRUNCATED_MULTIPART_LISTING</dt>
 * <dd>Returns the listing as if it is truncated. See below for details.</dd>
 * <p/>
 * </dl>
 * </p>
 */
@Override
public MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest listMultipartUploadsRequest,
        AmazonS3Client s3Client) {
    if (listMultipartUploadsRequest.getBucketName().equals(MOCK_S3_BUCKET_NAME_SERVICE_EXCEPTION)) {
        throw new AmazonServiceException(null);
    } else if (listMultipartUploadsRequest.getBucketName()
            .equals(MOCK_S3_BUCKET_NAME_TRUNCATED_MULTIPART_LISTING)) {
        MultipartUploadListing multipartUploadListing = getMultipartUploadListing();

        // If listing request does not have upload ID marker set, mark the listing as truncated - this is done to truncate the multipart listing just once.
        if (listMultipartUploadsRequest.getUploadIdMarker() == null) {
            multipartUploadListing.setUploadIdMarker("TEST_UPLOAD_MARKER_ID");
            multipartUploadListing.setTruncated(true);
        }

        return multipartUploadListing;
    } else {
        return getMultipartUploadListing();
    }
}

From source file:org.finra.herd.dao.impl.MockS3OperationsImpl.java

License:Apache License

/**
 * {@inheritDoc} <p/> <p> Since a multipart upload in progress does not exist when in-memory, this method simply returns a preconfigured list. </p> <p>
 * Returns a mock {@link MultipartUploadListing} based on the parameters and hints provided. By default returns a mock listing as defiend by {@link
 * #getMultipartUploadListing()}. </p> <p> This operation takes the following hints when suffixed in listMultipartUploadsRequest.bucketName: <dl> <p/>
 * <dt>MOCK_S3_BUCKET_NAME_SERVICE_EXCEPTION</dt> <dd>Throws a AmazonServiceException</dd> <p/> <dt>MOCK_S3_BUCKET_NAME_TRUNCATED_MULTIPART_LISTING</dt>
 * <dd>Returns the listing as if it is truncated. See below for details.</dd> <p/> </dl> </p>
 *//*from   w ww  .ja  va  2  s  .  c  o  m*/
@Override
public MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest listMultipartUploadsRequest,
        AmazonS3 s3Client) {
    if (listMultipartUploadsRequest.getBucketName().equals(MOCK_S3_BUCKET_NAME_SERVICE_EXCEPTION)) {
        throw new AmazonServiceException(null);
    } else if (listMultipartUploadsRequest.getBucketName()
            .equals(MOCK_S3_BUCKET_NAME_TRUNCATED_MULTIPART_LISTING)) {
        MultipartUploadListing multipartUploadListing = getMultipartUploadListing();

        // If listing request does not have upload ID marker set, mark the listing as truncated - this is done to truncate the multipart listing just once.
        if (listMultipartUploadsRequest.getUploadIdMarker() == null) {
            multipartUploadListing.setNextUploadIdMarker("TEST_UPLOAD_MARKER_ID");
            multipartUploadListing.setNextKeyMarker("TEST_KEY_MARKER_ID");
            multipartUploadListing.setTruncated(true);
        }

        return multipartUploadListing;
    } else {
        return getMultipartUploadListing();
    }
}