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 AbstractUploadRequest
contentType, metadata -
Constructor Summary
ConstructorsConstructorDescriptionBytesUploadRequest(@NonNull byte[] bytes, @NonNull String key) BytesUploadRequest(@NonNull byte[] bytes, @NonNull String key, @NonNull String contentType) BytesUploadRequest(@NonNull byte[] bytes, @Nullable String contentType, @NonNull String key, @NonNull Map<String, String> metadata) -
Method Summary
Modifier and TypeMethodDescription@NonNull byte[]getBytes()@NonNull InputStreamReturns an input stream of the object to be stored.@NonNull StringgetKey()Methods inherited from class AbstractUploadRequest
getMetadata, setContentType, setMetadataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface UploadRequest
getMetadata, setContentType, setMetadata
-
Constructor Details
-
BytesUploadRequest
-
BytesUploadRequest
-
BytesUploadRequest
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfaceUploadRequest- Returns:
- the content type of this upload request.
-
getKey
- Specified by:
getKeyin interfaceUploadRequest- Returns:
- the file name with path.
-
getContentSize
- Specified by:
getContentSizein interfaceUploadRequest- Returns:
- the size of the file, in bytes.
-
getInputStream
Description copied from interface:UploadRequestReturns an input stream of the object to be stored.Callers must not access the stream while an upload is in progress. Provider implementations may close it, so callers that own the stream should ensure it is closed after a blocking upload returns or after a reactive upload terminates.
- Specified by:
getInputStreamin interfaceUploadRequest- Returns:
- an input stream of the object to be stored.
-
getBytes
public @NonNull byte[] getBytes()- Returns:
- the byte array source.
-