Example usage for com.amazonaws.services.glacier.model UploadListElement getCreationDate

List of usage examples for com.amazonaws.services.glacier.model UploadListElement getCreationDate

Introduction

In this page you can find the example usage for com.amazonaws.services.glacier.model UploadListElement getCreationDate.

Prototype


public String getCreationDate() 

Source Link

Document

The UTC time at which the multipart upload was initiated.

Usage

From source file:baldrickv.s3streamingtool.GlacierCleanupMultipart.java

License:Open Source License

public static void cleanup(S3StreamConfig config) throws Exception {

    AmazonGlacierClient glacier = config.getGlacierClient();
    String bucket = config.getS3Bucket();

    ListMultipartUploadsRequest list_req = new ListMultipartUploadsRequest(bucket);

    List<UploadListElement> list = glacier.listMultipartUploads(list_req).getUploadsList();

    Scanner scan = new Scanner(System.in);

    for (UploadListElement mu : list) {
        System.out.println("-----------------------");
        System.out.println("  bucket: " + bucket);
        System.out.println("  desc: " + mu.getArchiveDescription());
        System.out.println("  uploadId: " + mu.getMultipartUploadId());
        System.out.println("  initiated at: " + mu.getCreationDate());
        System.out.println("-----------------------");

        System.out.print("Abort this upload [y|N]? ");
        String result = scan.nextLine().trim().toLowerCase();
        if (result.equals("y")) {
            AbortMultipartUploadRequest abort = new AbortMultipartUploadRequest(bucket,
                    mu.getMultipartUploadId());

            glacier.abortMultipartUpload(abort);
            System.out.println("Aborted upload");
        } else {//from w  w w. j a  v  a2  s .com
            System.out.println("Leaving this one alone");

        }

    }

}