Class S3Utils

java.lang.Object
org.nuxeo.ecm.blob.s3.S3Utils

public class S3Utils extends Object
AWS S3 utilities.
Since:
10.1
  • Field Details

  • Method Details

    • processSlices

      public static void processSlices(long slice, long length, S3Utils.SliceConsumer consumer)
      Calls the consumer on all slices.
      Parameters:
      slice - the slice size
      length - the total length
      consumer - the slice consumer
    • getAwsCredentialsProvider

      public static software.amazon.awssdk.auth.credentials.AwsCredentialsProvider getAwsCredentialsProvider(String accessKeyId, String secretKey, String sessionToken)
      Gets the credentials providers for the given AWS key and secret.
      Parameters:
      accessKeyId - the AWS access key id
      secretKey - the secret key
      sessionToken - the session token (optional)
      Since:
      10.10
    • isOnGoingRestore

      public static boolean isOnGoingRestore(String restoreHeader)
      AWS SDK V2 does not have an API to check if a S3 object is being restored.
      Returns:
      true if the restore header indicates a restore is in progress, false otherwise
      Since:
      2025.0
    • getRestoreExpiryDate

      public static Instant getRestoreExpiryDate(String restoreHeader)
      AWS SDK V2 does not have an API to get the expiry date of an expired object.
      Returns:
      the instant representing the expiry date if any, null otherwise
      Since:
      2025.0
    • sanitizeETag

      public static String sanitizeETag(String responseETag)
      Returns:
      the sanitized eTag
      Since:
      2025.0