Class MongoGridFsClient
- All Implemented Interfaces:
MutinyDelegate
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMongoGridFsClient
(io.vertx.ext.mongo.MongoGridFsClient delegate) MongoGridFsClient
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
io.smallrye.mutiny.Uni<Void>
Deletes a file by it's IDdeleteAndAwait
(String id) Blocking variant ofdelete(String)
.Variant ofdelete(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
downloadByFileName
(WriteStream<Buffer> stream, String fileName) downloadByFileNameAndAwait
(WriteStream<Buffer> stream, String fileName) downloadByFileNameAndForget
(WriteStream<Buffer> stream, String fileName) io.smallrye.mutiny.Uni<Long>
downloadByFileNameWithOptions
(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) downloadByFileNameWithOptionsAndAwait
(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) downloadByFileNameWithOptionsAndForget
(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) io.smallrye.mutiny.Uni<Long>
downloadById
(WriteStream<Buffer> stream, String id) downloadByIdAndAwait
(WriteStream<Buffer> stream, String id) downloadByIdAndForget
(WriteStream<Buffer> stream, String id) io.smallrye.mutiny.Uni<Long>
downloadFile
(String fileName) Downloads a file.downloadFileAndAwait
(String fileName) Blocking variant ofdownloadFile(String)
.downloadFileAndForget
(String fileName) Variant ofdownloadFile(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
downloadFileAs
(String fileName, String newFileName) Downloads a file and gives it a new name.downloadFileAsAndAwait
(String fileName, String newFileName) Blocking variant ofdownloadFileAs(String,String)
.downloadFileAsAndForget
(String fileName, String newFileName) Variant ofdownloadFileAs(String,String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
downloadFileByID
(String id, String fileName) Downloads a file using the ID generated by GridFs.downloadFileByIDAndAwait
(String id, String fileName) Blocking variant ofdownloadFileByID(String,String)
.downloadFileByIDAndForget
(String id, String fileName) Variant ofdownloadFileByID(String,String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
drop()
Drops the entire file bucket with all of its contentsBlocking variant ofdrop()
.Variant ofdrop()
that ignores the result of the operation.boolean
Finds all file ids in the bucketBlocking variant offindAllIds()
.Variant offindAllIds()
that ignores the result of the operation.findIds
(io.vertx.core.json.JsonObject query) Finds all file ids that match a query.findIdsAndAwait
(io.vertx.core.json.JsonObject query) Blocking variant offindIds(JsonObject)
.findIdsAndForget
(io.vertx.core.json.JsonObject query) Variant offindIds(JsonObject)
that ignores the result of the operation.io.vertx.ext.mongo.MongoGridFsClient
int
hashCode()
static MongoGridFsClient
newInstance
(io.vertx.ext.mongo.MongoGridFsClient arg) readByFileName
(String fileName) readByFileNameWithOptions
(String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) toString()
io.smallrye.mutiny.Uni<String>
uploadByFileName
(ReadStream<Buffer> stream, String fileName) io.smallrye.mutiny.Uni<String>
uploadByFileName
(Flow.Publisher<Buffer> stream, String fileName) uploadByFileNameAndAwait
(ReadStream<Buffer> stream, String fileName) uploadByFileNameAndAwait
(Flow.Publisher<Buffer> stream, String fileName) uploadByFileNameAndForget
(ReadStream<Buffer> stream, String fileName) uploadByFileNameAndForget
(Flow.Publisher<Buffer> stream, String fileName) io.smallrye.mutiny.Uni<String>
uploadByFileNameWithOptions
(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) io.smallrye.mutiny.Uni<String>
uploadByFileNameWithOptions
(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) uploadByFileNameWithOptionsAndAwait
(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) uploadByFileNameWithOptionsAndAwait
(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) uploadByFileNameWithOptionsAndForget
(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) uploadByFileNameWithOptionsAndForget
(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) io.smallrye.mutiny.Uni<String>
uploadFile
(String fileName) Upload a file to gridfsuploadFileAndAwait
(String fileName) Blocking variant ofuploadFile(String)
.uploadFileAndForget
(String fileName) Variant ofuploadFile(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<String>
uploadFileWithOptions
(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) Upload a file to gridfs with optionsuploadFileWithOptionsAndAwait
(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) Blocking variant ofuploadFileWithOptions(String,GridFsUploadOptions)
.uploadFileWithOptionsAndForget
(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) Variant ofuploadFileWithOptions(String,GridFsUploadOptions)
that ignores the result of the operation.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
MongoGridFsClient
public MongoGridFsClient(io.vertx.ext.mongo.MongoGridFsClient delegate) -
MongoGridFsClient
-
-
Method Details
-
getDelegate
public io.vertx.ext.mongo.MongoGridFsClient getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
delete
Deletes a file by it's IDUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
id
- the identifier of the file- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
deleteAndAwait
Blocking variant ofdelete(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
id
- the identifier of the file- Returns:
- the Void instance produced by the operation.
-
deleteAndForget
Variant ofdelete(String)
that ignores the result of the operation.This method subscribes on the result of
delete(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdelete(String)
but you don't need to compose it with other operations.- Parameters:
id
- the identifier of the file- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
readByFileName
- Parameters:
fileName
-- Returns:
-
readByFileNameWithOptions
public ReadStream<Buffer> readByFileNameWithOptions(String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) - Parameters:
fileName
-options
-- Returns:
-
readById
- Parameters:
id
-- Returns:
-
downloadByFileName
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadByFileName(WriteStream<Buffer> stream, String fileName) -
downloadByFileNameAndAwait
-
downloadByFileNameAndForget
-
downloadByFileNameWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) -
downloadByFileNameWithOptionsAndAwait
public Long downloadByFileNameWithOptionsAndAwait(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) -
downloadByFileNameWithOptionsAndForget
public MongoGridFsClient downloadByFileNameWithOptionsAndForget(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options) -
downloadById
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadById(WriteStream<Buffer> stream, String id) -
downloadByIdAndAwait
-
downloadByIdAndForget
-
downloadFile
Downloads a file.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
fileName
- the name of the file to download- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
downloadFileAndAwait
Blocking variant ofdownloadFile(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
fileName
- the name of the file to download- Returns:
- the Long instance produced by the operation.
-
downloadFileAndForget
Variant ofdownloadFile(String)
that ignores the result of the operation.This method subscribes on the result of
downloadFile(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdownloadFile(String)
but you don't need to compose it with other operations.- Parameters:
fileName
- the name of the file to download- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
downloadFileAs
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadFileAs(String fileName, String newFileName) Downloads a file and gives it a new name.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
fileName
- the name of the file to downloadnewFileName
- the name the file should be saved as- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
downloadFileAsAndAwait
Blocking variant ofdownloadFileAs(String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
fileName
- the name of the file to downloadnewFileName
- the name the file should be saved as- Returns:
- the Long instance produced by the operation.
-
downloadFileAsAndForget
Variant ofdownloadFileAs(String,String)
that ignores the result of the operation.This method subscribes on the result of
downloadFileAs(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdownloadFileAs(String,String)
but you don't need to compose it with other operations.- Parameters:
fileName
- the name of the file to downloadnewFileName
- the name the file should be saved as- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
downloadFileByID
Downloads a file using the ID generated by GridFs.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
id
- the GridFs Object ID of the file to downloadfileName
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
downloadFileByIDAndAwait
Blocking variant ofdownloadFileByID(String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
id
- the GridFs Object ID of the file to downloadfileName
-- Returns:
- the Long instance produced by the operation.
-
downloadFileByIDAndForget
Variant ofdownloadFileByID(String,String)
that ignores the result of the operation.This method subscribes on the result of
downloadFileByID(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdownloadFileByID(String,String)
but you don't need to compose it with other operations.- Parameters:
id
- the GridFs Object ID of the file to downloadfileName
-- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
drop
Drops the entire file bucket with all of its contentsUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
dropAndAwait
Blocking variant ofdrop()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
dropAndForget
Variant ofdrop()
that ignores the result of the operation.This method subscribes on the result of
drop()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdrop()
but you don't need to compose it with other operations.- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
findAllIds
Finds all file ids in the bucketUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findAllIdsAndAwait
Blocking variant offindAllIds()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the List
instance produced by the operation.
-
findAllIdsAndForget
Variant offindAllIds()
that ignores the result of the operation.This method subscribes on the result of
findAllIds()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindAllIds()
but you don't need to compose it with other operations.- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
findIds
@CheckReturnValue public io.smallrye.mutiny.Uni<List<String>> findIds(io.vertx.core.json.JsonObject query) Finds all file ids that match a query.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
query
- a bson query expressed as json that will be used to match files- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
findIdsAndAwait
Blocking variant offindIds(JsonObject)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
query
- a bson query expressed as json that will be used to match files- Returns:
- the List
instance produced by the operation.
-
findIdsAndForget
Variant offindIds(JsonObject)
that ignores the result of the operation.This method subscribes on the result of
findIds(JsonObject)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromfindIds(JsonObject)
but you don't need to compose it with other operations.- Parameters:
query
- a bson query expressed as json that will be used to match files- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
uploadByFileName
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadByFileName(ReadStream<Buffer> stream, String fileName) -
uploadByFileNameAndAwait
-
uploadByFileNameAndForget
-
uploadByFileName
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadByFileName(Flow.Publisher<Buffer> stream, String fileName) -
uploadByFileNameAndAwait
-
uploadByFileNameAndForget
-
uploadByFileNameWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) -
uploadByFileNameWithOptionsAndAwait
public String uploadByFileNameWithOptionsAndAwait(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) -
uploadByFileNameWithOptionsAndForget
public MongoGridFsClient uploadByFileNameWithOptionsAndForget(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) -
uploadByFileNameWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadByFileNameWithOptions(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) -
uploadByFileNameWithOptionsAndAwait
public String uploadByFileNameWithOptionsAndAwait(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) -
uploadByFileNameWithOptionsAndForget
public MongoGridFsClient uploadByFileNameWithOptionsAndForget(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) -
uploadFile
Upload a file to gridfsUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
fileName
- the name of the file to store in gridfs- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
uploadFileAndAwait
Blocking variant ofuploadFile(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
fileName
- the name of the file to store in gridfs- Returns:
- the String instance produced by the operation.
-
uploadFileAndForget
Variant ofuploadFile(String)
that ignores the result of the operation.This method subscribes on the result of
uploadFile(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromuploadFile(String)
but you don't need to compose it with other operations.- Parameters:
fileName
- the name of the file to store in gridfs- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
uploadFileWithOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadFileWithOptions(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) Upload a file to gridfs with optionsUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
fileName
- the name of the file to store in gridfsoptions
-GridFsUploadOptions
for specifying metadata and chunk size- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
uploadFileWithOptionsAndAwait
public String uploadFileWithOptionsAndAwait(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) Blocking variant ofuploadFileWithOptions(String,GridFsUploadOptions)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
fileName
- the name of the file to store in gridfsoptions
-GridFsUploadOptions
for specifying metadata and chunk size- Returns:
- the String instance produced by the operation.
-
uploadFileWithOptionsAndForget
public MongoGridFsClient uploadFileWithOptionsAndForget(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options) Variant ofuploadFileWithOptions(String,GridFsUploadOptions)
that ignores the result of the operation.This method subscribes on the result of
uploadFileWithOptions(String,GridFsUploadOptions)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromuploadFileWithOptions(String,GridFsUploadOptions)
but you don't need to compose it with other operations.- Parameters:
fileName
- the name of the file to store in gridfsoptions
-GridFsUploadOptions
for specifying metadata and chunk size- Returns:
- the instance of MongoGridFsClient to chain method calls.
-
close
public void close() -
newInstance
-