Last active
December 12, 2015 06:38
-
-
Save bageljp/f1bb6b7c5f096fc02803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public PutObjectResult put(String key, InputStream input, long length) { | |
ObjectMetadata objectMetadata = new ObjectMetadata(); | |
objectMetadata.setContentLength(length); | |
objectMetadata.setContentType("image/gif"); | |
PutObjectRequest request = new PutObjectRequest(this.bucket, key, input, objectMetadata); | |
request.withCannedAcl(CannedAccessControlList.PublicRead); | |
log.info("S3にファイルをアップロードします… bucket:" + this.bucket + "\tkey:" + key); | |
PutObjectResult result = this.s3Client.putObject(request); | |
log.info("S3にファイルをアップロードしました。 bucket:" + this.bucket + "\tkey:" + key); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment