@IdiotProofImmutable public final class DefaultS3Service extends Object implements S3Service
Modifier and Type | Class and Description |
---|---|
static class |
DefaultS3Service.Builder |
Modifier and Type | Method and Description |
---|---|
static DefaultS3Service |
build(com.amazonaws.auth.AWSCredentials credentials) |
static DefaultS3Service.Builder |
builder(com.amazonaws.auth.AWSCredentials credentials) |
CopyObjectResult |
copyObject(String bucket,
String srcKey,
String dstKey)
Copy an object in a bucket to another name.
|
Bucket |
createBucket(String bucket)
Create a new bucket
|
boolean |
exists(String bucket,
String key)
Return true if we are able to determine that this key exists in this bucket.
|
com.amazonaws.auth.AWSCredentials |
getCredentials() |
com.amazonaws.services.s3.model.CannedAccessControlList |
getDefaultPermissions() |
String |
getRegion()
Return the region we are operating on
|
PutObjectResult |
putFile(String bucket,
String key,
File file)
Copy a file from the local file system to a bucket using UTF8
|
PutObjectResult |
putFile(String bucket,
String key,
File file,
String encoding)
Copy a file from the local file system to a bucket using the indicated encoding
|
String |
readObjectToString(String bucket,
String key)
Read the contents of an object into a string using UTF8
|
PutObjectResult |
writeStringToObject(String bucket,
String key,
String data)
Write a string to a bucket using UTF8
|
public Bucket createBucket(String bucket)
public boolean exists(String bucket, String key)
exists
in interface S3Service
IllegalArgumentException
- If bucket or key are blank or the bucket does not exist.com.amazonaws.services.s3.model.AmazonS3Exception
- If the bucket exists but permissions deny read access to the bucket or objectpublic PutObjectResult putFile(String bucket, String key, File file)
S3Service
public PutObjectResult putFile(String bucket, String key, File file, String encoding)
S3Service
public PutObjectResult writeStringToObject(String bucket, String key, String data)
S3Service
writeStringToObject
in interface S3Service
public String readObjectToString(String bucket, String key)
S3Service
readObjectToString
in interface S3Service
public CopyObjectResult copyObject(String bucket, String srcKey, String dstKey)
copyObject
in interface S3Service
public static DefaultS3Service build(com.amazonaws.auth.AWSCredentials credentials)
public static DefaultS3Service.Builder builder(com.amazonaws.auth.AWSCredentials credentials)
public com.amazonaws.auth.AWSCredentials getCredentials()
public String getRegion()
S3Service
public com.amazonaws.services.s3.model.CannedAccessControlList getDefaultPermissions()
Copyright © 2004–2014 The Kuali Foundation. All rights reserved.