Class BytesUploadRequest

java.lang.Object
io.micronaut.objectstorage.request.AbstractUploadRequest
io.micronaut.objectstorage.request.BytesUploadRequest
All Implemented Interfaces:
UploadRequest

public class BytesUploadRequest extends AbstractUploadRequest implements UploadRequest
Upload request implementation using byte array.
Since:
1.0
Author:
Burt Beckwith
  • Constructor Details

    • BytesUploadRequest

      public BytesUploadRequest(@NonNull @io.micronaut.core.annotation.NonNull byte[] bytes, @NonNull @NonNull String key)
    • BytesUploadRequest

      public BytesUploadRequest(@NonNull @io.micronaut.core.annotation.NonNull byte[] bytes, @NonNull @NonNull String key, @NonNull @NonNull String contentType)
    • BytesUploadRequest

      public BytesUploadRequest(@NonNull @io.micronaut.core.annotation.NonNull byte[] bytes, @Nullable @Nullable String contentType, @NonNull @NonNull String key, @NonNull @NonNull Map<String,String> metadata)
  • Method Details

    • getContentType

      @NonNull public @NonNull Optional<String> getContentType()
      Specified by:
      getContentType in interface UploadRequest
      Returns:
      the content type of this upload request.
    • getKey

      @NonNull public @NonNull String getKey()
      Specified by:
      getKey in interface UploadRequest
      Returns:
      the file name with path.
    • getContentSize

      @NonNull public @NonNull Optional<Long> getContentSize()
      Specified by:
      getContentSize in interface UploadRequest
      Returns:
      the size of the file, in bytes.
    • getInputStream

      @NonNull public @NonNull InputStream getInputStream()
      Specified by:
      getInputStream in interface UploadRequest
      Returns:
      an input stream of the object to be stored.
    • getBytes

      @NonNull public @io.micronaut.core.annotation.NonNull byte[] getBytes()
      Returns:
      the byte array source.