public interface AwsS3IamService
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkBucketPermission(String bucketName,
com.amazonaws.services.s3.model.Permission permission)
Check bucket permission.
If access to the given bucket is not valid then 'AccessDenied' error will be raised. Read ACP permission should be available to user who is trying to check permission on bucket. |
boolean |
checkObjectPermission(String bucketName,
String key,
com.amazonaws.services.s3.model.Permission permission)
Check object permission.
If object is not available in given bucket, an exception will be thrown |
void |
cleanAndDeleteBucket(String bucketName)
Clean and delete bucket.
|
com.amazonaws.services.s3.model.Bucket |
createBucket(String bucketName)
Creates the bucket.
A bucket is owned by the AWS account that created it. |
com.amazonaws.services.s3.model.Bucket |
createBucket(String bucketName,
boolean isPublicAccessible)
Creates the bucket.
Permission set for a Bucket does NOT automatically propagate to files stored in that Bucket. A bucket is owned by the AWS account that created it. |
com.amazonaws.services.s3.model.Bucket |
createBucket(String bucketName,
com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl)
Creates the bucket.
A bucket is owned by the AWS account that created it. |
com.amazonaws.services.s3.model.PutObjectResult |
createDirectory(String bucketName,
String dirName)
Creates the directory.
|
com.amazonaws.services.s3.model.PutObjectResult |
createDirectory(String bucketName,
String dirName,
boolean isPublicAccessible)
Creates the directory.
You can pass true/false flag to allow directories created in S3 to be publicly accessible. |
com.amazonaws.services.s3.model.PutObjectResult |
createDirectory(String bucketName,
String dirName,
com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl)
Creates the directory.
|
void |
deleteBucket(String bucketName)
Delete bucket.
|
void |
deleteDirectory(String bucketName,
String dirName)
Delete directory.
|
void |
deleteObject(String bucketName,
String fileName)
Delete object.
|
com.amazonaws.services.s3.model.DeleteObjectsResult |
deleteObjects(String bucketName,
List<com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion> keys)
Delete objects.
|
com.amazonaws.services.s3.model.ObjectMetadata |
downloadObject(String bucketName,
String key,
String filePath)
Download object.
|
URL |
generateObjectURL(String bucketName,
String fileName)
Generate object url.
|
String |
generateObjectUrlAsString(String bucketName,
String fileName)
Generate object url as string.
|
List<com.amazonaws.services.s3.model.Bucket> |
getAllBuckets()
Gets the all buckets.
|
com.amazonaws.services.s3.model.AccessControlList |
getBucketAccessControlList(String bucketName)
Gets the bucket access control list.
Provides opportunities to grant permissions and check permissions on bucket. If access to the given bucket is not valid then 'AccessDenied' error will be raised. Read ACP permission should be available to user who is trying to check permission on bucket. |
List<com.amazonaws.services.s3.model.Grant> |
getBucketPermissions(String bucketName)
Gets the bucket permissions.
Returns the list of Grant objects in this access control list (ACL). The Grant object has Permission object which tell what kind of permissions are available. and it has Grantee object which tell who are grantees. Following are permissions available: FullControl, Read, Write, ReadAcp, WriteAcp If access to the given bucket is not valid then 'AccessDenied' error will be raised. |
com.amazonaws.services.s3.model.S3Object |
getObject(com.amazonaws.services.s3.model.GetObjectRequest getObjRequest)
Gets the object.
|
InputStream |
getObject(String bucketName,
String key)
Gets the object.
|
boolean |
hasFullControlPermission(String bucketName)
Checks if the bucket has full control permission
If access to the given bucket is not valid then 'AccessDenied' error will be raised. Read ACP permission should be available to user who is trying to check permission on bucket. |
boolean |
hasWritePermissionOnBucket(String bucketName)
Checks for write permission on s3 bucket.
It checks if user has write permissions on bucket or not, even if ReadACP is not granted. |
boolean |
isBucketExists(String bucketName)
Checks if is bucket exists.
|
com.amazonaws.services.s3.transfer.Transfer |
uploadDirectoryOrFile(String bucketName,
File source,
String virtualDirectoryKeyPrefix)
Upload directory or file.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the files or directory to S3 asynchronously You can use Transfer returning object to check for progress,
Usage: transfer.getProgress().getPercentTransferred()It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
boolean |
uploadDirectoryOrFileAndListenProgress(String bucketName,
File source,
String virtualDirectoryKeyPrefix)
Upload directory or file and Listen Progress.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the files or directory to S3 and prints the progress. It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
com.amazonaws.services.s3.transfer.Upload |
uploadFileAsync(String bucketName,
String fileName,
File fileObj)
Upload file async.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the file to S3 asynchronously You can use Upload returning object to check for progress
Usage: upload.getProgress().getPercentTransferred()It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
com.amazonaws.services.s3.transfer.Upload |
uploadFileAsync(String bucketName,
String fileName,
File fileObj,
boolean isPublicAccessible)
Upload file async.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the file to S3 asynchronously You can use Upload returning object to check for progress
Usage: upload.getProgress().getPercentTransferred()It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
com.amazonaws.services.s3.transfer.Upload |
uploadFileAsync(String bucketName,
String fileName,
File fileObj,
com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl)
Upload file async.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the file to S3 asynchronously You can use Upload returning object to check for progress
Usage: upload.getProgress().getPercentTransferred()It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
com.amazonaws.services.s3.model.PutObjectResult |
uploadObject(com.amazonaws.services.s3.model.PutObjectRequest putObjectRequest)
Upload object.
|
com.amazonaws.services.s3.model.PutObjectResult |
uploadObject(String bucketName,
String fileName,
InputStream inputStream)
Upload object.
|
com.amazonaws.services.s3.model.PutObjectResult |
uploadObject(String bucketName,
String fileName,
InputStream inputStream,
boolean isPublicAccessible)
Upload object.
You can pass true/false flag to allow objects pushed to S3 to be publicly accessible. |
com.amazonaws.services.s3.model.PutObjectResult |
uploadObject(String bucketName,
String fileName,
InputStream inputStream,
com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl)
Upload object.
|
boolean |
uploadObjectAndListenProgress(String bucketName,
String fileName,
InputStream inputStream)
Upload object and Listen progress.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the file to S3 and prints the progress. It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
boolean |
uploadObjectAndListenProgress(String bucketName,
String fileName,
InputStream inputStream,
boolean isPublicAccessible)
Upload object and Listen progress.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the file to S3 and prints the progress. It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
boolean |
uploadObjectAndListenProgress(String bucketName,
String fileName,
InputStream inputStream,
com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl)
Upload object and Listen progress.
S3 will overwrite any existing objects that happen to have the same key, just as when uploading individual files, so use with caution. This method will upload the file to S3 and prints the progress. It is implemented via TransferManager TransferManager provides a simple API for uploading content to Amazon S3, and makes extensive use of Amazon S3 multipart uploads to achieve enhanced throughput, performance and reliability. |
List<com.amazonaws.services.s3.model.Bucket> getAllBuckets() throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
com.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.Bucket createBucket(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.Bucket createBucket(String bucketName, com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namecannedAcl - the canned aclcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.Bucket createBucket(String bucketName, boolean isPublicAccessible) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket nameisPublicAccessible - the is public accessiblecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionvoid deleteBucket(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionvoid cleanAndDeleteBucket(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.PutObjectResult uploadObject(com.amazonaws.services.s3.model.PutObjectRequest putObjectRequest)
throws com.amazonaws.AmazonClientException,
com.amazonaws.AmazonServiceException
putObjectRequest - the put object requestcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.PutObjectResult uploadObject(String bucketName, String fileName, InputStream inputStream) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
bucketName - the bucket namefileName - the file nameinputStream - the input streamcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.com.amazonaws.services.s3.model.PutObjectResult uploadObject(String bucketName, String fileName, InputStream inputStream, com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
bucketName - the bucket namefileName - the file nameinputStream - the input streamcannedAcl - the canned aclcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.com.amazonaws.services.s3.model.PutObjectResult uploadObject(String bucketName, String fileName, InputStream inputStream, boolean isPublicAccessible) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
bucketName - the bucket namefileName - the file nameinputStream - the input streamisPublicAccessible - the is public accessiblecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.boolean uploadObjectAndListenProgress(String bucketName, String fileName, InputStream inputStream) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
TransferManager bucketName - the bucket namefileName - the file nameinputStream - the input streamcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.boolean uploadObjectAndListenProgress(String bucketName, String fileName, InputStream inputStream, com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
TransferManager bucketName - the bucket namefileName - the file nameinputStream - the input streamcannedAcl - the canned aclcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.boolean uploadObjectAndListenProgress(String bucketName, String fileName, InputStream inputStream, boolean isPublicAccessible) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
TransferManager bucketName - the bucket namefileName - the file nameinputStream - the input streamisPublicAccessible - the is public accessiblecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.boolean uploadDirectoryOrFileAndListenProgress(String bucketName, File source, String virtualDirectoryKeyPrefix) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, FileNotFoundException
TransferManager bucketName - the bucket namesource - the source fir or directoryvirtualDirectoryKeyPrefix - the key prefix of the virtual directory to upload to. Use the null or empty string to upload files to the root of the bucket.com.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionFileNotFoundException - the file not found exceptioncom.amazonaws.services.s3.transfer.Upload uploadFileAsync(String bucketName, String fileName, File fileObj) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
Upload returning object to check for progress
Usage: upload.getProgress().getPercentTransferred()TransferManager bucketName - the bucket namefileName - the file namefileObj - the file objectcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.com.amazonaws.services.s3.transfer.Upload uploadFileAsync(String bucketName, String fileName, File fileObj, com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
Upload returning object to check for progress
Usage: upload.getProgress().getPercentTransferred()TransferManager bucketName - the bucket namefileName - the file namefileObj - the file objectcannedAcl - the canned aclcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.com.amazonaws.services.s3.transfer.Upload uploadFileAsync(String bucketName, String fileName, File fileObj, boolean isPublicAccessible) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
Upload returning object to check for progress
Usage: upload.getProgress().getPercentTransferred()TransferManager bucketName - the bucket namefileName - the file namefileObj - the file objectisPublicAccessible - the is public accessiblecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.com.amazonaws.services.s3.transfer.Transfer uploadDirectoryOrFile(String bucketName, File source, String virtualDirectoryKeyPrefix) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, IOException
Transfer returning object to check for progress,
Usage: transfer.getProgress().getPercentTransferred()TransferManager bucketName - the bucket namesource - the source fir or directoryvirtualDirectoryKeyPrefix - the key prefix of the virtual directory to upload to. Use the null or empty string to upload files to the root of the bucket.com.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionIOException - Signals that an I/O exception has occurred.com.amazonaws.services.s3.model.S3Object getObject(com.amazonaws.services.s3.model.GetObjectRequest getObjRequest)
throws com.amazonaws.AmazonClientException,
com.amazonaws.AmazonServiceException
getObjRequest - the get obj requestcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionInputStream getObject(String bucketName, String key) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namekey - the keycom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.ObjectMetadata downloadObject(String bucketName, String key, String filePath) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namekey - the keyfilePath - the file pathcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.PutObjectResult createDirectory(String bucketName, String dirName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namedirName - the dir namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.PutObjectResult createDirectory(String bucketName, String dirName, com.amazonaws.services.s3.model.CannedAccessControlList cannedAcl) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namedirName - the dir namecannedAcl - the canned aclcom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.PutObjectResult createDirectory(String bucketName, String dirName, boolean isPublicAccessible) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namedirName - the dir nameisPublicAccessible - the is public accessiblecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionvoid deleteObject(String bucketName, String fileName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namefileName - the file namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.DeleteObjectsResult deleteObjects(String bucketName, List<com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion> keys) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namekeys - the keyscom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionvoid deleteDirectory(String bucketName, String dirName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namedirName - the dir namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionboolean isBucketExists(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionString generateObjectUrlAsString(String bucketName, String fileName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namefileName - the file namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionURL generateObjectURL(String bucketName, String fileName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException
bucketName - the bucket namefileName - the file namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptionList<com.amazonaws.services.s3.model.Grant> getBucketPermissions(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, com.amazonaws.services.s3.model.AmazonS3Exception
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.AmazonS3Exception - the amazon s3 exceptionGrant,
Permission,
Grantee,
Permissionsboolean hasFullControlPermission(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, com.amazonaws.services.s3.model.AmazonS3Exception
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.AmazonS3Exception - the amazon s3 exceptioncom.amazonaws.services.s3.model.AccessControlList getBucketAccessControlList(String bucketName) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, com.amazonaws.services.s3.model.AmazonS3Exception
bucketName - the bucket namecom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.AmazonS3Exception - the amazon s3 exceptionAccessControlList,
Permissionsboolean checkBucketPermission(String bucketName, com.amazonaws.services.s3.model.Permission permission) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, com.amazonaws.services.s3.model.AmazonS3Exception
bucketName - the bucket namepermission - the permissioncom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.AmazonS3Exception - the amazon s3 exceptionboolean checkObjectPermission(String bucketName, String key, com.amazonaws.services.s3.model.Permission permission) throws com.amazonaws.AmazonClientException, com.amazonaws.AmazonServiceException, com.amazonaws.services.s3.model.AmazonS3Exception
bucketName - the bucket namekey - the full path of object in given bucketpermission - the permissioncom.amazonaws.AmazonClientException - the amazon client exceptioncom.amazonaws.AmazonServiceException - the amazon service exceptioncom.amazonaws.services.s3.model.AmazonS3Exception - the amazon s3 exceptionboolean hasWritePermissionOnBucket(String bucketName)
bucketName - the bucket nameCopyright © 2015. Abhinav Kumar Mishra. All rights reserved.