Package org.cdlib.mrt.s3v2.action
Class GetObject
java.lang.Object
org.cdlib.mrt.s3v2.action.GetObject
Before running this Java V2 code example, set up your development
environment, including your credentials.
For more information, see the following documentation topic:
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
downloadObjectFuture
(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient, String bucketName, String keyName, String path) Asynchronously retrieves the bytes of an object from an Amazon S3 bucket and writes them to a local file.static software.amazon.awssdk.services.s3.model.GetObjectResponse
downloadObjectTransfer
(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient, String bucketName, String key, String downloadedFileWithPath) static void
getObjectSync
(software.amazon.awssdk.services.s3.S3Client s3Client, String bucketName, String keyName, String path) static InputStream
getObjectSyncInputStream
(software.amazon.awssdk.services.s3.S3Client s3Client, String bucketName, String keyName)
-
Field Details
-
logger
protected static final org.apache.logging.log4j.Logger logger -
getSSM
-
-
Constructor Details
-
GetObject
public GetObject()
-
-
Method Details
-
downloadObjectFuture
public static void downloadObjectFuture(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient, String bucketName, String keyName, String path) Asynchronously retrieves the bytes of an object from an Amazon S3 bucket and writes them to a local file.- Parameters:
bucketName
- the name of the S3 bucket containing the objectkeyName
- the key (or name) of the S3 object to retrievepath
- the local file path where the object's bytes will be written
-
downloadObjectTransfer
-
getObjectSync
public static void getObjectSync(software.amazon.awssdk.services.s3.S3Client s3Client, String bucketName, String keyName, String path) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-
getObjectSyncInputStream
public static InputStream getObjectSyncInputStream(software.amazon.awssdk.services.s3.S3Client s3Client, String bucketName, String keyName) throws org.cdlib.mrt.utility.TException - Throws:
org.cdlib.mrt.utility.TException
-