Package com.amazonaws.services.s3.transfer.internal

Examples of com.amazonaws.services.s3.transfer.internal.DownloadMonitor


    protected Queue<Exchange> createExchanges(List<S3ObjectSummary> s3ObjectSummaries) {
        LOG.trace("Received {} messages in this poll", s3ObjectSummaries.size());
       
        Queue<Exchange> answer = new LinkedList<Exchange>();
        for (S3ObjectSummary s3ObjectSummary : s3ObjectSummaries) {
            S3Object s3Object = getAmazonS3Client().getObject(s3ObjectSummary.getBucketName(), s3ObjectSummary.getKey());
            Exchange exchange = getEndpoint().createExchange(s3Object);
            answer.add(exchange);
        }

        return answer;
View Full Code Here


       
        ObjectListing objectListing = new ObjectListing();
        int capacity = listObjectsRequest.getMaxKeys();
       
        for (int index = 0; index < objects.size() && index < capacity; index++) {
            S3ObjectSummary s3ObjectSummary = new S3ObjectSummary();
            s3ObjectSummary.setBucketName(objects.get(index).getBucketName());
            s3ObjectSummary.setKey(objects.get(index).getKey());
           
            objectListing.getObjectSummaries().add(s3ObjectSummary);
        }

        return objectListing;
View Full Code Here

                boolean ok=false;
                final List<S3ObjectSummary> out= Lists.newArrayList();

                if("pathoDromic".equals(r.getPrefix())) {
                    out.add(new S3ObjectSummary());
                    ok=true;
                }

                if("way-out/".equals(r.getPrefix())) {
                    ok=true;
View Full Code Here

        try {
            for (int part = 1; filePosition < contentLength; part++) {
                partSize = Math.min(partSize, contentLength - filePosition);

                UploadPartRequest uploadRequest = new UploadPartRequest()
                        .withBucketName(getConfiguration().getBucketName()).withKey(keyName)
                        .withUploadId(initResponse.getUploadId()).withPartNumber(part)
                        .withFileOffset(filePosition)
                        .withFile(filePayload)
                        .withPartSize(partSize);
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

                    });
                   

                    if (s3Object == null) {
                        download.setState(TransferState.Canceled);
                        download.setMonitor(new DownloadMonitor(download, null));
                        return download;
                    }


                    download.setState(TransferState.Completed);
                    return true;
                } catch (Exception e) {
                    // Downloads aren't allowed to move from canceled to failed
                    if (download.getState() != TransferState.Canceled) {
                        download.setState(TransferState.Failed);
                    }
                    throw e;
                }
            }
        });
        download.setMonitor(new DownloadMonitor(download, future));
        synchronized (startDownloadLock) {
            startDownloadLock.downloadReady = true;
            startDownloadLock.notify();
        }
        return download;
View Full Code Here

        }
        transferProgress.setTotalBytesToTransfer(contentLength);
        final CountDownLatch latch = new CountDownLatch(1);
        Future<?> future = submitDownloadTask(getObjectRequest, file,
                resumeExistingDownload, latch, download);
        download.setMonitor(new DownloadMonitor(download, future));
        latch.countDown();
        return download;
    }
View Full Code Here

                            }
                        }, resumeExistingDownload);

                    if (s3Object == null) {
                        download.setState(TransferState.Canceled);
                        download.setMonitor(new DownloadMonitor(download, null));
                        return download;
                    }

                    download.setState(TransferState.Completed);
                    return true;
View Full Code Here

        }
        transferProgress.setTotalBytesToTransfer(contentLength);
        final CountDownLatch latch = new CountDownLatch(1);
        Future<?> future = submitDownloadTask(getObjectRequest, file,
                resumeExistingDownload, latch, download);
        download.setMonitor(new DownloadMonitor(download, future));
        latch.countDown();
        return download;
    }
View Full Code Here

                            }
                        }, resumeExistingDownload);

                    if (s3Object == null) {
                        download.setState(TransferState.Canceled);
                        download.setMonitor(new DownloadMonitor(download, null));
                        return download;
                    }

                    download.setState(TransferState.Completed);
                    return true;
View Full Code Here

TOP

Related Classes of com.amazonaws.services.s3.transfer.internal.DownloadMonitor

Copyright © 2018 www.massapicom. 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.