Package org.jets3t.service

Examples of org.jets3t.service.S3Service


                            // supposed to be empty
                        }
                        break;
                    case NORMAL:
                        // IAM GATK user credentials -- only right is to PutObject into broad.gsa.gatk.run.reports bucket
                        final S3Service s3Service = initializeAWSService(getAWSUploadAccessKey(), getAWSUploadSecretKey());

                        // Create an S3Object based on a file, with Content-Length set automatically and
                        // Content-Type set based on the file's extension (using the Mimetypes utility class)
                        final S3Object fileObject = new S3Object(filename, contents);
                        //logger.info("Created S3Object" + fileObject);
                        //logger.info("Uploading " + localFile + " to AWS bucket");
                        s3Object = s3Service.putObject(getS3ReportBucket(), fileObject);
                        isSuccess.set(true);
                        break;
                    default:
                        throw new IllegalStateException("Unexpected AWS exception");
                }
View Full Code Here


                Assert.assertNotNull(report.getErrorThrown());
        }
    }

    private void deleteFromS3(final GATKRunReport report) throws Exception {
        final S3Service s3Service = GATKRunReport.initializeAWSService(downloaderAccessKey, downloaderSecretKey);
        // Retrieve the whole data object we created previously
        s3Service.deleteObject(report.getS3ReportBucket(), report.getReportFileName());
    }
View Full Code Here

        report.sendAWSToTestBucket();
        final S3Object s3Object = report.postReportToAWSS3();
        Assert.assertNotNull(s3Object, "Upload to AWS failed, s3Object was null. error was " + report.formatError());

        // create a service with the public key, and make sure it cannot list or delete
        final S3Service s3Service = GATKRunReport.initializeAWSService(GATKRunReport.getAWSUploadAccessKey(), GATKRunReport.getAWSUploadSecretKey());
        assertOperationNotAllowed("listAllBuckets", new S3Op() {
            @Override
            public void apply() throws S3ServiceException {
                s3Service.listAllBuckets();
            }
        });
        assertOperationNotAllowed("listBucket", new S3Op() {
            @Override
            public void apply() throws S3ServiceException { s3Service.listObjects(report.getS3ReportBucket()); }
        });
        assertOperationNotAllowed("createBucket", new S3Op() {
            @Override
            public void apply() throws S3ServiceException { s3Service.createBucket("ShouldNotCreate"); }
        });
        assertOperationNotAllowed("deleteObject", new S3Op() {
            @Override
            public void apply() throws ServiceException { s3Service.deleteObject(report.getS3ReportBucket(), report.getReportFileName()); }
        });
    }
View Full Code Here

            }
            log.debug("Downloading NED degree tile " + path);
            // download the file from S3.
            AWSCredentials awsCredentials = new AWSCredentials(awsAccessKey, awsSecretKey);
            try {
                S3Service s3Service = new RestS3Service(awsCredentials);
                String key = formatLatLon(x, y) + ".tiff";
                S3Object object = s3Service.getObject("ned13", key);

                InputStream istream = object.getDataInputStream();
                FileOutputStream ostream = new FileOutputStream(path);

                byte[] buffer = new byte[4096];
View Full Code Here

TOP

Related Classes of org.jets3t.service.S3Service

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.