Package com.amazonaws.services.s3.model

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


        Date lastModified = exchange.getIn().getHeader(S3Constants.LAST_MODIFIED, Date.class);
        if (lastModified != null) {
            objectMetadata.setLastModified(lastModified);
        }
       
        PutObjectRequest putObjectRequest = new PutObjectRequest(
                getConfiguration().getBucketName(),
                determineKey(exchange),
                exchange.getIn().getMandatoryBody(InputStream.class),
                objectMetadata);

        String storageClass = determineStorageClass(exchange);
        if (storageClass != null) {
            putObjectRequest.setStorageClass(storageClass);
        }

        LOG.trace("Put object [{}] from exchange [{}]...", putObjectRequest, exchange);
       
        PutObjectResult putObjectResult = getEndpoint().getS3Client().putObject(putObjectRequest);
View Full Code Here


       
        assertMockEndpointsSatisfied();
       
        assertResultExchange(result.getExchanges().get(0));
       
        PutObjectRequest putObjectRequest = client.putObjectRequests.get(0);
        assertEquals("REDUCED_REDUNDANCY", putObjectRequest.getStorageClass());
        assertEquals("mycamelbucket", putObjectRequest.getBucketName());
       
        assertResponseMessage(exchange.getIn());
    }
View Full Code Here

       
        assertMockEndpointsSatisfied();
       
        assertResultExchange(result.getExchanges().get(0));
       
        PutObjectRequest putObjectRequest = client.putObjectRequests.get(0);
        assertEquals("REDUCED_REDUNDANCY", putObjectRequest.getStorageClass());
        assertEquals("mycamelbucket", putObjectRequest.getBucketName());
       
        assertResponseMessage(exchange.getOut());
    }
View Full Code Here

       
        assertMockEndpointsSatisfied();
       
        assertResultExchange(result.getExchanges().get(0));
       
        PutObjectRequest putObjectRequest = client.putObjectRequests.get(0);
        assertEquals("STANDARD", putObjectRequest.getStorageClass());
        assertEquals("mycamelbucket", putObjectRequest.getBucketName());
        assertEquals(2L, putObjectRequest.getMetadata().getContentLength());
        assertEquals("text/html", putObjectRequest.getMetadata().getContentType());
        assertEquals("no-cache", putObjectRequest.getMetadata().getCacheControl());
        assertEquals("attachment;", putObjectRequest.getMetadata().getContentDisposition());
        assertEquals("gzip", putObjectRequest.getMetadata().getContentEncoding());
        assertEquals("TWF", putObjectRequest.getMetadata().getContentMD5());
        assertEquals(now, putObjectRequest.getMetadata().getLastModified());
       
        assertResponseMessage(exchange.getIn());
    }
View Full Code Here

    /* (non-Javadoc)
     * @see com.amazonaws.services.s3.AmazonS3#putObject(java.lang.String, java.lang.String, java.io.File)
     */
    public PutObjectResult putObject(String bucketName, String key, File file)
            throws AmazonClientException, AmazonServiceException {
        return putObject(new PutObjectRequest(bucketName, key, file)
            .withMetadata(new ObjectMetadata()));
    }
View Full Code Here

    /* (non-Javadoc)
     * @see com.amazonaws.services.s3.AmazonS3#putObject(java.lang.String, java.lang.String, java.io.InputStream, com.amazonaws.services.s3.model.S3ObjectMetadata)
     */
    public PutObjectResult putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata)
            throws AmazonClientException, AmazonServiceException {
        return putObject(new PutObjectRequest(bucketName, key, input, metadata));
    }
View Full Code Here

            // PutObjectRequest#setAccessControlList for more details
            putObjectRequest.setAccessControlList(acl);
        }
        LOG.trace("Put object [{}] from exchange [{}]...", putObjectRequest, exchange);

        PutObjectResult putObjectResult = getEndpoint().getS3Client().putObject(putObjectRequest);

        LOG.trace("Received result [{}]", putObjectResult);

        Message message = getMessageForResponse(exchange);
        message.setHeader(S3Constants.E_TAG, putObjectResult.getETag());
        if (putObjectResult.getVersionId() != null) {
            message.setHeader(S3Constants.VERSION_ID, putObjectResult.getVersionId());
        }

        if (getConfiguration().isDeleteAfterWrite() && filePayload != null) {
            IOHelper.close(putObjectRequest.getInputStream());
            FileUtil.deleteFile(filePayload);
View Full Code Here

        } else {
            s3Object.setObjectContent(putObjectRequest.getInputStream());
        }
        objects.add(s3Object);
       
        PutObjectResult putObjectResult = new PutObjectResult();
        putObjectResult.setETag("3a5c8b1ad448bca04584ecb55b836264");
        return putObjectResult;
    }
View Full Code Here

        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

            putObjectRequest.setStorageClass(storageClass);
        }

        LOG.trace("Put object [{}] from exchange [{}]...", putObjectRequest, exchange);
       
        PutObjectResult putObjectResult = getEndpoint().getS3Client().putObject(putObjectRequest);

        LOG.trace("Received result [{}]", putObjectResult);
       
        Message message = getMessageForResponse(exchange);
        message.setHeader(S3Constants.E_TAG, putObjectResult.getETag());
        if (putObjectResult.getVersionId() != null) {
            message.setHeader(S3Constants.VERSION_ID, putObjectResult.getVersionId());           
        }
    }
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.