@Named public class S3Helper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
NO_SUCH_KEY |
Constructor and Description |
---|
S3Helper() |
S3Helper(com.amazonaws.services.s3.AmazonS3 client) |
Modifier and Type | Method and Description |
---|---|
com.amazonaws.services.s3.model.CopyObjectResult |
copy(S3Location source,
S3Location target)
Copy object to another bucket.
|
com.amazonaws.services.s3.model.CopyObjectResult |
copy(String sourceBucket,
String sourceKey,
String targetBucket,
String targetKey)
Copy object to another bucket.
|
void |
copyLocal(com.amazonaws.services.s3.model.S3Object source,
File target)
Copy object to local file.
|
File |
copyTemp(com.amazonaws.services.s3.model.S3Object source,
String prefix,
String suffix)
Copy object to local temporary file.
|
com.amazonaws.services.s3.model.S3Object |
get(S3Location location)
Get object.
|
com.amazonaws.services.s3.model.S3Object |
get(String bucket,
String key)
Get object.
|
com.amazonaws.services.s3.AmazonS3 |
getClient() |
static boolean |
isNoSuchKeyError(com.amazonaws.services.s3.model.AmazonS3Exception cause)
Check if given exception represents a
NO_SUCH_KEY error. |
com.amazonaws.services.s3.model.PutObjectResult |
put(String bucket,
String key,
File file)
Put object.
|
public static final String NO_SUCH_KEY
@Inject public S3Helper(com.amazonaws.services.s3.AmazonS3 client)
public S3Helper()
public com.amazonaws.services.s3.AmazonS3 getClient()
public com.amazonaws.services.s3.model.S3Object get(S3Location location)
public com.amazonaws.services.s3.model.PutObjectResult put(String bucket, String key, File file)
public com.amazonaws.services.s3.model.CopyObjectResult copy(String sourceBucket, String sourceKey, String targetBucket, String targetKey)
public com.amazonaws.services.s3.model.CopyObjectResult copy(S3Location source, S3Location target)
public void copyLocal(com.amazonaws.services.s3.model.S3Object source, File target) throws IOException
IOException
public File copyTemp(com.amazonaws.services.s3.model.S3Object source, String prefix, String suffix) throws IOException
IOException
public static boolean isNoSuchKeyError(com.amazonaws.services.s3.model.AmazonS3Exception cause)
NO_SUCH_KEY
error.Copyright © 2018–2019 Sonatype, Inc.. All rights reserved.