Class FileUploadRequest

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

public class FileUploadRequest extends AbstractUploadRequest implements UploadRequest
Upload request implementation using File.
  • Constructor Details

    • FileUploadRequest

      public FileUploadRequest(@NonNull @NonNull Path localFilePath)
    • FileUploadRequest

      public FileUploadRequest(@NonNull @NonNull Path localFilePath, @Nullable @Nullable String prefix)
    • FileUploadRequest

      public FileUploadRequest(@NonNull @NonNull Path localFilePath, @NonNull @NonNull String keyName, @Nullable @Nullable String prefix, @Nullable @Nullable String contentType)
    • FileUploadRequest

      public FileUploadRequest(@NonNull @NonNull String keyName, @Nullable @Nullable String contentType, @NonNull @NonNull Path path, @NonNull @NonNull Map<String,String> metadata)
  • Method Details

    • getFile

      @NonNull public @NonNull File getFile()
      Returns:
      The File associated with the underlying Path.
    • getPath

      @NonNull public @NonNull Path getPath()
      Returns:
      The underlying Path.
    • getAbsolutePath

      @NonNull public @NonNull String getAbsolutePath()
      Returns:
      The absolute path of the underlying Path.
    • 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.