Class BytesUploadRequest
java.lang.Object
io.micronaut.objectstorage.request.AbstractUploadRequest
io.micronaut.objectstorage.request.BytesUploadRequest
- All Implemented Interfaces:
UploadRequest
Upload request implementation using byte array.
- Since:
- 1.0
- Author:
- Burt Beckwith
-
Field Summary
Fields inherited from class io.micronaut.objectstorage.request.AbstractUploadRequest
contentType, metadata
-
Constructor Summary
ConstructorDescriptionBytesUploadRequest
(@io.micronaut.core.annotation.NonNull byte[] bytes, @NonNull String key) BytesUploadRequest
(@io.micronaut.core.annotation.NonNull byte[] bytes, @NonNull String key, @NonNull String contentType) BytesUploadRequest
(@io.micronaut.core.annotation.NonNull byte[] bytes, @Nullable String contentType, @NonNull String key, @NonNull Map<String, String> metadata) -
Method Summary
Modifier and TypeMethodDescription@io.micronaut.core.annotation.NonNull byte[]
getBytes()
@NonNull InputStream
@NonNull String
getKey()
Methods inherited from class io.micronaut.objectstorage.request.AbstractUploadRequest
getMetadata, setContentType, setMetadata
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.objectstorage.request.UploadRequest
getMetadata, setContentType, setMetadata
-
Constructor Details
-
BytesUploadRequest
public BytesUploadRequest(@NonNull @io.micronaut.core.annotation.NonNull byte[] bytes, @NonNull @NonNull String key) -
BytesUploadRequest
-
BytesUploadRequest
-
-
Method Details
-
getContentType
- Specified by:
getContentType
in interfaceUploadRequest
- Returns:
- the content type of this upload request.
-
getKey
- Specified by:
getKey
in interfaceUploadRequest
- Returns:
- the file name with path.
-
getContentSize
- Specified by:
getContentSize
in interfaceUploadRequest
- Returns:
- the size of the file, in bytes.
-
getInputStream
- Specified by:
getInputStream
in interfaceUploadRequest
- 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.
-