Class PresignRequest

java.lang.Object
io.micronaut.objectstorage.request.PresignRequest

public final class PresignRequest extends Object
Request object for generating pre-authorized (signed) operations against the object storage.
Since:
2.10.0
  • Method Details

    • getKey

      @NonNull public @NonNull String getKey()
      Returns:
      The object key/path. (/foo/bar/file).
    • getOperation

      @NonNull public @NonNull PresignRequest.Operation getOperation()
      Operation for which the pre-signed request should be generated.
      Returns:
      The operation to pre-sign.
    • getExpiresIn

      @NonNull public @NonNull Optional<Duration> getExpiresIn()
      Optional expiration override for the generated request. If empty, the implementation will fall back to the configured default (typically 1 hour).
      Returns:
      An Optional expiration override for the generated request.
    • getContentLength

      @NonNull public @NonNull Optional<Long> getContentLength()
      Optional expected content length (bytes) for upload operations. Implementations may embed this as a maximum allowed size within the signature.
      Returns:
      An Optional expected content length for upload operations.
    • getContentType

      @NonNull public @NonNull Optional<String> getContentType()
      Optional content-type hint for upload operations.
      Returns:
      An Optional content-type hint for upload operations.
    • getName

      @NonNull public @NonNull Optional<String> getName()
      Optional custom name for the pre-authorized request. If empty, the provider will generate a default name.
      Returns:
      An Optional containing the custom name for the pre-authorized request.
      Since:
      2.10
    • builder

      @NonNull public static @NonNull PresignRequest.Builder builder(@NonNull @NonNull String key, @NonNull @NonNull PresignRequest.Operation operation)
      Creates a new builder.
      Parameters:
      key - The object key/path.
      operation - The operation to pre-sign.
      Returns:
      A new PresignRequest.Builder instance.