Package com.amazonaws.services.s3.transfer

Examples of com.amazonaws.services.s3.transfer.Copy.waitForCompletion()


                && minModifiedDate > getLastModified(identifier)) {
                CopyObjectRequest copReq = new CopyObjectRequest(bucket, key,
                    bucket, key);
                copReq.setNewObjectMetadata(new ObjectMetadata());
                Copy copy = tmx.copy(copReq);
                copy.waitForCompletion();
                LOG.debug("[{}] touched. time taken [{}] ms ", new Object[] {
                    identifier, (System.currentTimeMillis() - start) });
            } else {
                LOG.debug("[{}] touch not required. time taken [{}] ms ",
                    new Object[] { identifier,
View Full Code Here


        System.out.println("uplaod to s3 bucket");
        File file = new File(pathToUpload);
//        s3.putObject(bucketName, file.getName(), file);
        MultipleFileUpload mfu = tm.uploadDirectory(bucketName, null, file, true);
        try {
            mfu.waitForCompletion();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        tm.shutdownNow();
    }
View Full Code Here

    private void doItForJob(String jobId) throws InterruptedException {
        logger.info("Beginning download of "+jobId);
        String bucketName= getLast(on("/").omitEmptyStrings().split(awsLogUri));
        Transfer that=transferManager.downloadDirectory(bucketName, jobId, new File(localLogTarget));
        that.waitForCompletion();
    }
}
View Full Code Here

    } else {
      throw new MojoExecutionException("File is neither a regular file nor a directory " + sourceFile);
    }
    try {
      getLog().debug("Transferring " + transfer.getProgress().getTotalBytesToTransfer() + " bytes...");
      transfer.waitForCompletion();
      getLog().info("Transferred " + transfer.getProgress().getBytesTransfered() + " bytes.");
    } catch (InterruptedException e) {
      return false;
    }
View Full Code Here

            });
            // TransferManager processes all transfers asynchronously,
            // so this call will return immediately.
            Upload upload = tm.upload(putObjectRequest);

            upload.waitForCompletion();

            // finished or aborted
            Date finish = new Date();
            String downloaded = "(incomplete download)";
            if (totalBytes >= remoteSize) {
View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Multipart sending file %1$s as S3 object %2$s in " + "bucket %3$s", sourceFile.getName(), key, bucketName));
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(bucketName, key, sourceFile);
        upload.waitForCompletion();
    }

    // multi-part upload object
    public static void mputObject(final ClientOptions clientOptions, final InputStream sourceStream, final String bucketName, final String key)
        throws InterruptedException {
View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Multipart sending stream as S3 object %1$s in " + "bucket %2$s", key, bucketName));
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(bucketName, key, sourceStream, null);
        upload.waitForCompletion();
    }

    // multi-part upload object
    public static void mputObject(final ClientOptions clientOptions, final PutObjectRequest req) throws InterruptedException {
View Full Code Here

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Multipart sending object to S3 using PutObjectRequest");
        }
        TransferManager tm = new TransferManager(S3Utils.acquireClient(clientOptions));
        Upload upload = tm.upload(req);
        upload.waitForCompletion();

    }

    public static void setObjectAcl(final ClientOptions clientOptions, final String bucketName, final String key, final CannedAccessControlList acl) {
View Full Code Here

                if (log.isDebugEnabled()) {
                    upload.addProgressListener(createProgressListener(upload));
                }

                upload.waitForCompletion();
                log.debug("Completed upload for host: %s, key: %s", host, key);
            }
            catch (AmazonClientException e) {
                throw new IOException(e);
            }
View Full Code Here

                if (log.isDebugEnabled()) {
                    upload.addProgressListener(createProgressListener(upload));
                }

                upload.waitForCompletion();
                log.debug("Completed upload for host: %s, key: %s", host, key);
            }
            catch (AmazonClientException e) {
                throw new IOException(e);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.