Package com.amazonaws.services.s3.model

Examples of com.amazonaws.services.s3.model.Region


                        "Client calculated content hash didn't match hash calculated by Amazon S3.  " +
                        "You may need to delete the data stored in Amazon S3.");
            }
        }

        PutObjectResult result = new PutObjectResult();
        result.setETag(returnedMetadata.getETag());
        result.setVersionId(returnedMetadata.getVersionId());
        return result;
    }
View Full Code Here


            s3service = Utils.openService(prop);
            if (bucket == null || "".equals(bucket.trim())) {
                bucket = prop.getProperty(S3Constants.S3_BUCKET);
            }
            String region = prop.getProperty(S3Constants.S3_REGION);
            Region s3Region = null;
            String endpoint = null;
            if (DEFAULT_AWS_BUCKET_REGION.equals(region)) {
                s3Region =  Region.US_Standard;
                endpoint = S3 + DOT + AWSDOTCOM;
            } else if (Region.EU_Ireland.toString().equals(region)) {
View Full Code Here

     * @param client
     *            An {@link AmazonS3Client} to use in the cache. Its region will
     *            be detected automatically.
     */
    public void useClient(AmazonS3Client client) {
        Region s3region = client.getRegion();

        synchronized (transferManagersByRegion) {
            TransferManager tm = transferManagersByRegion.remove(s3region);
            if (tm != null) {
                tm.shutdownNow();
View Full Code Here

            s3service = Utils.openService(prop);
            if (bucket == null || "".equals(bucket.trim())) {
                bucket = prop.getProperty(S3Constants.S3_BUCKET);
            }
            String region = prop.getProperty(S3Constants.S3_REGION);
            Region s3Region = null;
            String endpoint = null;
            if (DEFAULT_AWS_BUCKET_REGION.equals(region)) {
                s3Region =  Region.US_Standard;
                endpoint = S3 + DOT + AWSDOTCOM;
            } else if (Region.EU_Ireland.toString().equals(region)) {
View Full Code Here

     * @param client
     *            An {@link AmazonS3Client} to use in the cache. Its region will
     *            be detected automatically.
     */
    public void useClient(AmazonS3Client client) {
        Region s3region = client.getRegion();

        synchronized (transferManagersByRegion) {
            TransferManager tm = transferManagersByRegion.remove(s3region);
            if (tm != null) {
                tm.shutdownNow();
View Full Code Here

        this.service = service;
        this.transferManager = new TransferManager(service);
        this.serverSideEncryption = S3FileSystemConfigBuilder
            .getInstance().getServerSideEncryption(fileSystemOptions);

        Region region = S3FileSystemConfigBuilder.getInstance().getRegion(
            fileSystemOptions);
        if (region != null)
            service.setRegion(region.toAWSRegion());

        try {
            if (service.doesBucketExist(bucketId)) {
                bucket = new Bucket(bucketId);
            } else {
View Full Code Here

    @SuppressWarnings("resource")
    @Override
    public PutObjectResult putObject(PutObjectRequest putObjectRequest) throws AmazonClientException, AmazonServiceException {
        putObjectRequests.add(putObjectRequest);
       
        S3Object s3Object = new S3Object();
        s3Object.setBucketName(putObjectRequest.getBucketName());
        s3Object.setKey(putObjectRequest.getKey());
        if (putObjectRequest.getFile() != null) {
            try {
                s3Object.setObjectContent(new FileInputStream(putObjectRequest.getFile()));
            } catch (FileNotFoundException e) {
                throw new AmazonServiceException("Cannot store the file object.", e);
            }
        } else {
            s3Object.setObjectContent(putObjectRequest.getInputStream());
        }
        objects.add(s3Object);
       
        PutObjectResult putObjectResult = new PutObjectResult();
        putObjectResult.setETag("3a5c8b1ad448bca04584ecb55b836264");
View Full Code Here

    }

    @Override
    public InputStream openInput(String blobName) throws IOException {
        try {
            S3Object s3Object = blobStore.client().getObject(blobStore.bucket(), buildKey(blobName));
            return s3Object.getObjectContent();
        } catch (AmazonS3Exception e) {
            if (e.getStatusCode() == 404) {
                throw new FileNotFoundException(e.getMessage());
            }
            throw e;
View Full Code Here

    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

    @Override
    public PutObjectResult putObject(PutObjectRequest putObjectRequest) throws AmazonClientException, AmazonServiceException {
        putObjectRequests.add(putObjectRequest);
       
        S3Object s3Object = new S3Object();
        s3Object.setBucketName(putObjectRequest.getBucketName());
        s3Object.setKey(putObjectRequest.getKey());
        s3Object.setObjectContent(putObjectRequest.getInputStream());
        objects.add(s3Object);
       
        PutObjectResult putObjectResult = new PutObjectResult();
        putObjectResult.setETag("3a5c8b1ad448bca04584ecb55b836264");
        return putObjectResult;
View Full Code Here

TOP

Related Classes of com.amazonaws.services.s3.model.Region

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.