Class GetObject

java.lang.Object
org.cdlib.mrt.s3v2.action.GetObject

public class GetObject extends Object
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 Details

    • logger

      protected static final org.apache.logging.log4j.Logger logger
    • getSSM

      public static GetSSM 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 object
      keyName - the key (or name) of the S3 object to retrieve
      path - the local file path where the object's bytes will be written
    • downloadObjectTransfer

      public static software.amazon.awssdk.services.s3.model.GetObjectResponse downloadObjectTransfer(software.amazon.awssdk.services.s3.S3AsyncClient s3AsyncClient, String bucketName, String key, String downloadedFileWithPath)
    • 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