Class CompletedFileUploadRequest

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

public class CompletedFileUploadRequest extends Object implements UploadRequest
An UploadRequest backed by a CompletedFileUpload.
Since:
1.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Details

    • CompletedFileUploadRequest

      public CompletedFileUploadRequest(@NonNull @NonNull io.micronaut.http.multipart.CompletedFileUpload completedFileUpload)
    • CompletedFileUploadRequest

      public CompletedFileUploadRequest(@NonNull @NonNull io.micronaut.http.multipart.CompletedFileUpload completedFileUpload, @NonNull @NonNull String key)
    • CompletedFileUploadRequest

      public CompletedFileUploadRequest(@NonNull @NonNull io.micronaut.http.multipart.CompletedFileUpload completedFileUpload, @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.
    • getMetadata

      @NonNull public @NonNull Map<String,String> getMetadata()
      Specified by:
      getMetadata in interface UploadRequest
      Returns:
      a map with key-value pairs to be stored along the file. An empty map by default.
    • setMetadata

      public void setMetadata(@NonNull @NonNull Map<String,String> metadata)
      Specified by:
      setMetadata in interface UploadRequest
      Parameters:
      metadata - a map with key-value pairs to be stored along the file.