Class StreamingFileUploadRequest

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

public class StreamingFileUploadRequest extends Object implements UploadRequest
An UploadRequest backed by a StreamingFileUpload.
Since:
2.7.0
  • Constructor Details

    • StreamingFileUploadRequest

      public StreamingFileUploadRequest(@NonNull @NonNull io.micronaut.http.multipart.StreamingFileUpload streamingFileUpload)
    • StreamingFileUploadRequest

      public StreamingFileUploadRequest(@NonNull @NonNull io.micronaut.http.multipart.StreamingFileUpload streamingFileUpload, @NonNull @NonNull String key)
    • StreamingFileUploadRequest

      public StreamingFileUploadRequest(@NonNull @NonNull io.micronaut.http.multipart.StreamingFileUpload streamingFileUpload, @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.