Class MongoGridFsClient
- java.lang.Object
-
- io.vertx.mutiny.ext.mongo.MongoGridFsClient
-
public class MongoGridFsClient extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MongoGridFsClient>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description MongoGridFsClient(io.vertx.ext.mongo.MongoGridFsClient delegate)
MongoGridFsClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
io.smallrye.mutiny.Uni<Void>
delete(String id)
Deletes a file by it's IDVoid
deleteAndAwait(String id)
Blocking variant ofdelete(String)
.MongoGridFsClient
deleteAndForget(String id)
Variant ofdelete(String)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Long>
downloadByFileName(WriteStream<Buffer> stream, String fileName)
Long
downloadByFileNameAndAwait(WriteStream<Buffer> stream, String fileName)
MongoGridFsClient
downloadByFileNameAndForget(WriteStream<Buffer> stream, String fileName)
io.smallrye.mutiny.Uni<Long>
downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options)
Long
downloadByFileNameWithOptionsAndAwait(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options)
MongoGridFsClient
downloadByFileNameWithOptionsAndForget(WriteStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options)
io.smallrye.mutiny.Uni<Long>
downloadById(WriteStream<Buffer> stream, String id)
Long
downloadByIdAndAwait(WriteStream<Buffer> stream, String id)
MongoGridFsClient
downloadByIdAndForget(WriteStream<Buffer> stream, String id)
io.smallrye.mutiny.Uni<Long>
downloadFile(String fileName)
Downloads a file.Long
downloadFileAndAwait(String fileName)
Blocking variant ofdownloadFile(String)
.MongoGridFsClient
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.Long
downloadFileAsAndAwait(String fileName, String newFileName)
Blocking variant ofdownloadFileAs(String,String)
.MongoGridFsClient
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.Long
downloadFileByIDAndAwait(String id, String fileName)
Blocking variant ofdownloadFileByID(String,String)
.MongoGridFsClient
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 contentsVoid
dropAndAwait()
Blocking variant ofdrop()
.MongoGridFsClient
dropAndForget()
Variant ofdrop()
that ignores the result of the operation.boolean
equals(Object o)
io.smallrye.mutiny.Uni<List<String>>
findAllIds()
Finds all file ids in the bucketList<String>
findAllIdsAndAwait()
Blocking variant offindAllIds()
.MongoGridFsClient
findAllIdsAndForget()
Variant offindAllIds()
that ignores the result of the operation.io.smallrye.mutiny.Uni<List<String>>
findIds(io.vertx.core.json.JsonObject query)
Finds all file ids that match a query.List<String>
findIdsAndAwait(io.vertx.core.json.JsonObject query)
Blocking variant offindIds(JsonObject)
.MongoGridFsClient
findIdsAndForget(io.vertx.core.json.JsonObject query)
Variant offindIds(JsonObject)
that ignores the result of the operation.io.vertx.ext.mongo.MongoGridFsClient
getDelegate()
int
hashCode()
static MongoGridFsClient
newInstance(io.vertx.ext.mongo.MongoGridFsClient arg)
ReadStream<Buffer>
readByFileName(String fileName)
ReadStream<Buffer>
readByFileNameWithOptions(String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options)
ReadStream<Buffer>
readById(String id)
String
toString()
io.smallrye.mutiny.Uni<String>
uploadByFileName(ReadStream<Buffer> stream, String fileName)
io.smallrye.mutiny.Uni<String>
uploadByFileName(Flow.Publisher<Buffer> stream, String fileName)
String
uploadByFileNameAndAwait(ReadStream<Buffer> stream, String fileName)
String
uploadByFileNameAndAwait(Flow.Publisher<Buffer> stream, String fileName)
MongoGridFsClient
uploadByFileNameAndForget(ReadStream<Buffer> stream, String fileName)
MongoGridFsClient
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)
String
uploadByFileNameWithOptionsAndAwait(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options)
String
uploadByFileNameWithOptionsAndAwait(Flow.Publisher<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options)
MongoGridFsClient
uploadByFileNameWithOptionsAndForget(ReadStream<Buffer> stream, String fileName, io.vertx.ext.mongo.GridFsUploadOptions options)
MongoGridFsClient
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 gridfsString
uploadFileAndAwait(String fileName)
Blocking variant ofuploadFile(String)
.MongoGridFsClient
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 optionsString
uploadFileWithOptionsAndAwait(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options)
Blocking variant ofuploadFileWithOptions(String,GridFsUploadOptions)
.MongoGridFsClient
uploadFileWithOptionsAndForget(String fileName, io.vertx.ext.mongo.GridFsUploadOptions options)
Variant ofuploadFileWithOptions(String,GridFsUploadOptions)
that ignores the result of the operation.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MongoGridFsClient> __TYPE_ARG
-
-
Constructor Detail
-
MongoGridFsClient
public MongoGridFsClient(io.vertx.ext.mongo.MongoGridFsClient delegate)
-
MongoGridFsClient
public MongoGridFsClient(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.mongo.MongoGridFsClient getDelegate()
-
delete
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> delete(String id)
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
public Void deleteAndAwait(String id)
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
public MongoGridFsClient deleteAndForget(String id)
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
public ReadStream<Buffer> readByFileName(String fileName)
- Parameters:
fileName
-- Returns:
-
readByFileNameWithOptions
public ReadStream<Buffer> readByFileNameWithOptions(String fileName, io.vertx.ext.mongo.GridFsDownloadOptions options)
- Parameters:
fileName
-options
-- Returns:
-
readById
public ReadStream<Buffer> readById(String id)
- Parameters:
id
-- Returns:
-
downloadByFileName
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadByFileName(WriteStream<Buffer> stream, String fileName)
-
downloadByFileNameAndAwait
public Long downloadByFileNameAndAwait(WriteStream<Buffer> stream, String fileName)
-
downloadByFileNameAndForget
public MongoGridFsClient downloadByFileNameAndForget(WriteStream<Buffer> stream, String fileName)
-
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
public Long downloadByIdAndAwait(WriteStream<Buffer> stream, String id)
-
downloadByIdAndForget
public MongoGridFsClient downloadByIdAndForget(WriteStream<Buffer> stream, String id)
-
downloadFile
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadFile(String fileName)
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
public Long downloadFileAndAwait(String fileName)
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
public MongoGridFsClient downloadFileAndForget(String fileName)
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
public Long downloadFileAsAndAwait(String fileName, String newFileName)
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
public MongoGridFsClient downloadFileAsAndForget(String fileName, String newFileName)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<Long> downloadFileByID(String id, String fileName)
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
public Long downloadFileByIDAndAwait(String id, String fileName)
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
public MongoGridFsClient downloadFileByIDAndForget(String id, String fileName)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> 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
public Void 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
public MongoGridFsClient 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
@CheckReturnValue public io.smallrye.mutiny.Uni<List<String>> 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
public List<String> 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
public MongoGridFsClient 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
public List<String> findIdsAndAwait(io.vertx.core.json.JsonObject query)
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
public MongoGridFsClient findIdsAndForget(io.vertx.core.json.JsonObject query)
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
public String uploadByFileNameAndAwait(ReadStream<Buffer> stream, String fileName)
-
uploadByFileNameAndForget
public MongoGridFsClient uploadByFileNameAndForget(ReadStream<Buffer> stream, String fileName)
-
uploadByFileName
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadByFileName(Flow.Publisher<Buffer> stream, String fileName)
-
uploadByFileNameAndAwait
public String uploadByFileNameAndAwait(Flow.Publisher<Buffer> stream, String fileName)
-
uploadByFileNameAndForget
public MongoGridFsClient uploadByFileNameAndForget(Flow.Publisher<Buffer> stream, String fileName)
-
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
@CheckReturnValue public io.smallrye.mutiny.Uni<String> uploadFile(String fileName)
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
public String uploadFileAndAwait(String fileName)
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
public MongoGridFsClient uploadFileAndForget(String fileName)
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
public static MongoGridFsClient newInstance(io.vertx.ext.mongo.MongoGridFsClient arg)
-
-