Package io.vertx.reactivex.ext.mongo
Class MongoGridFsClient
- java.lang.Object
-
- io.vertx.reactivex.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(MongoGridFsClient delegate)MongoGridFsClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the client and release its resourcesMongoGridFsClientdelete(String id)Deletes a file by it's IDMongoGridFsClientdelete(String id, Handler<AsyncResult<Void>> resultHandler)Deletes a file by it's IDMongoGridFsClientdownloadByFileName(WriteStream<Buffer> stream, String fileName)MongoGridFsClientdownloadByFileName(WriteStream<Buffer> stream, String fileName, Handler<AsyncResult<Long>> resultHandler)MongoGridFsClientdownloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options)MongoGridFsClientdownloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options, Handler<AsyncResult<Long>> resultHandler)MongoGridFsClientdownloadById(WriteStream<Buffer> stream, String id)MongoGridFsClientdownloadById(WriteStream<Buffer> stream, String id, Handler<AsyncResult<Long>> resultHandler)MongoGridFsClientdownloadFile(String fileName)Downloads a file.MongoGridFsClientdownloadFile(String fileName, Handler<AsyncResult<Long>> resultHandler)Downloads a file.MongoGridFsClientdownloadFileAs(String fileName, String newFileName)Downloads a file and gives it a new name.MongoGridFsClientdownloadFileAs(String fileName, String newFileName, Handler<AsyncResult<Long>> resultHandler)Downloads a file and gives it a new name.MongoGridFsClientdownloadFileByID(String id, String fileName)Downloads a file using the ID generated by GridFs.MongoGridFsClientdownloadFileByID(String id, String fileName, Handler<AsyncResult<Long>> resultHandler)Downloads a file using the ID generated by GridFs.MongoGridFsClientdrop()Drops the entire file bucket with all of its contentsMongoGridFsClientdrop(Handler<AsyncResult<Void>> resultHandler)Drops the entire file bucket with all of its contentsbooleanequals(Object o)MongoGridFsClientfindAllIds()Finds all file ids in the bucketMongoGridFsClientfindAllIds(Handler<AsyncResult<List<String>>> resultHandler)Finds all file ids in the bucketMongoGridFsClientfindIds(JsonObject query)Finds all file ids that match a query.MongoGridFsClientfindIds(JsonObject query, Handler<AsyncResult<List<String>>> resultHandler)Finds all file ids that match a query.MongoGridFsClientgetDelegate()inthashCode()static MongoGridFsClientnewInstance(MongoGridFsClient arg)ReadStream<Buffer>readByFileName(String fileName)Read file by name to ReadStreamReadStream<Buffer>readByFileNameWithOptions(String fileName, GridFsDownloadOptions options)Read file by name to ReadStream with optionsReadStream<Buffer>readById(String id)Read file by id to ReadStreamio.reactivex.CompletablerxDelete(String id)Deletes a file by it's IDio.reactivex.Single<Long>rxDownloadByFileName(WriteStream<Buffer> stream, String fileName)io.reactivex.Single<Long>rxDownloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options)io.reactivex.Single<Long>rxDownloadById(WriteStream<Buffer> stream, String id)io.reactivex.Single<Long>rxDownloadFile(String fileName)Downloads a file.io.reactivex.Single<Long>rxDownloadFileAs(String fileName, String newFileName)Downloads a file and gives it a new name.io.reactivex.Single<Long>rxDownloadFileByID(String id, String fileName)Downloads a file using the ID generated by GridFs.io.reactivex.CompletablerxDrop()Drops the entire file bucket with all of its contentsio.reactivex.Single<List<String>>rxFindAllIds()Finds all file ids in the bucketio.reactivex.Single<List<String>>rxFindIds(JsonObject query)Finds all file ids that match a query.io.reactivex.Single<String>rxUploadByFileName(io.reactivex.Flowable<Buffer> stream, String fileName)io.reactivex.Single<String>rxUploadByFileName(ReadStream<Buffer> stream, String fileName)io.reactivex.Single<String>rxUploadByFileNameWithOptions(io.reactivex.Flowable<Buffer> stream, String fileName, GridFsUploadOptions options)io.reactivex.Single<String>rxUploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options)io.reactivex.Single<String>rxUploadFile(String fileName)Upload a file to gridfsio.reactivex.Single<String>rxUploadFileWithOptions(String fileName, GridFsUploadOptions options)Upload a file to gridfs with optionsStringtoString()MongoGridFsClientuploadByFileName(io.reactivex.Flowable<Buffer> stream, String fileName)MongoGridFsClientuploadByFileName(io.reactivex.Flowable<Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler)MongoGridFsClientuploadByFileName(ReadStream<Buffer> stream, String fileName)MongoGridFsClientuploadByFileName(ReadStream<Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler)MongoGridFsClientuploadByFileNameWithOptions(io.reactivex.Flowable<Buffer> stream, String fileName, GridFsUploadOptions options)MongoGridFsClientuploadByFileNameWithOptions(io.reactivex.Flowable<Buffer> stream, String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)MongoGridFsClientuploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options)MongoGridFsClientuploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)MongoGridFsClientuploadFile(String fileName)Upload a file to gridfsMongoGridFsClientuploadFile(String fileName, Handler<AsyncResult<String>> resultHandler)Upload a file to gridfsMongoGridFsClientuploadFileWithOptions(String fileName, GridFsUploadOptions options)Upload a file to gridfs with optionsMongoGridFsClientuploadFileWithOptions(String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)Upload a file to gridfs with options
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MongoGridFsClient> __TYPE_ARG
-
-
Constructor Detail
-
MongoGridFsClient
public MongoGridFsClient(MongoGridFsClient delegate)
-
MongoGridFsClient
public MongoGridFsClient(Object delegate)
-
-
Method Detail
-
getDelegate
public MongoGridFsClient getDelegate()
-
delete
public MongoGridFsClient delete(String id, Handler<AsyncResult<Void>> resultHandler)
Deletes a file by it's ID- Parameters:
id- the identifier of the fileresultHandler- will be called when the file is deleted- Returns:
-
delete
public MongoGridFsClient delete(String id)
Deletes a file by it's ID- Parameters:
id- the identifier of the file- Returns:
-
rxDelete
public io.reactivex.Completable rxDelete(String id)
Deletes a file by it's ID- Parameters:
id- the identifier of the file- Returns:
-
readByFileName
public ReadStream<Buffer> readByFileName(String fileName)
Read file by name to ReadStream- Parameters:
fileName-- Returns:
-
readByFileNameWithOptions
public ReadStream<Buffer> readByFileNameWithOptions(String fileName, GridFsDownloadOptions options)
Read file by name to ReadStream with options- Parameters:
fileName-options-- Returns:
-
readById
public ReadStream<Buffer> readById(String id)
Read file by id to ReadStream- Parameters:
id-- Returns:
-
downloadByFileName
public MongoGridFsClient downloadByFileName(WriteStream<Buffer> stream, String fileName, Handler<AsyncResult<Long>> resultHandler)
-
downloadByFileName
public MongoGridFsClient downloadByFileName(WriteStream<Buffer> stream, String fileName)
-
rxDownloadByFileName
public io.reactivex.Single<Long> rxDownloadByFileName(WriteStream<Buffer> stream, String fileName)
-
downloadByFileNameWithOptions
public MongoGridFsClient downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options, Handler<AsyncResult<Long>> resultHandler)
-
downloadByFileNameWithOptions
public MongoGridFsClient downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options)
-
rxDownloadByFileNameWithOptions
public io.reactivex.Single<Long> rxDownloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options)
-
downloadById
public MongoGridFsClient downloadById(WriteStream<Buffer> stream, String id, Handler<AsyncResult<Long>> resultHandler)
-
downloadById
public MongoGridFsClient downloadById(WriteStream<Buffer> stream, String id)
-
rxDownloadById
public io.reactivex.Single<Long> rxDownloadById(WriteStream<Buffer> stream, String id)
-
downloadFile
public MongoGridFsClient downloadFile(String fileName, Handler<AsyncResult<Long>> resultHandler)
Downloads a file.- Parameters:
fileName- the name of the file to downloadresultHandler- called when the file is downloaded and returns the length in bytes- Returns:
-
downloadFile
public MongoGridFsClient downloadFile(String fileName)
Downloads a file.- Parameters:
fileName- the name of the file to download- Returns:
-
rxDownloadFile
public io.reactivex.Single<Long> rxDownloadFile(String fileName)
Downloads a file.- Parameters:
fileName- the name of the file to download- Returns:
-
downloadFileAs
public MongoGridFsClient downloadFileAs(String fileName, String newFileName, Handler<AsyncResult<Long>> resultHandler)
Downloads a file and gives it a new name.- Parameters:
fileName- the name of the file to downloadnewFileName- the name the file should be saved asresultHandler- called when the file is downloaded and returns the length in bytes- Returns:
-
downloadFileAs
public MongoGridFsClient downloadFileAs(String fileName, String newFileName)
Downloads a file and gives it a new name.- Parameters:
fileName- the name of the file to downloadnewFileName- the name the file should be saved as- Returns:
-
rxDownloadFileAs
public io.reactivex.Single<Long> rxDownloadFileAs(String fileName, String newFileName)
Downloads a file and gives it a new name.- Parameters:
fileName- the name of the file to downloadnewFileName- the name the file should be saved as- Returns:
-
downloadFileByID
public MongoGridFsClient downloadFileByID(String id, String fileName, Handler<AsyncResult<Long>> resultHandler)
Downloads a file using the ID generated by GridFs.- Parameters:
id- the GridFs Object ID of the file to downloadfileName-resultHandler- called when the file is downloaded and returns the length in bytes- Returns:
-
downloadFileByID
public MongoGridFsClient downloadFileByID(String id, String fileName)
Downloads a file using the ID generated by GridFs.- Parameters:
id- the GridFs Object ID of the file to downloadfileName-- Returns:
-
rxDownloadFileByID
public io.reactivex.Single<Long> rxDownloadFileByID(String id, String fileName)
Downloads a file using the ID generated by GridFs.- Parameters:
id- the GridFs Object ID of the file to downloadfileName-- Returns:
-
drop
public MongoGridFsClient drop(Handler<AsyncResult<Void>> resultHandler)
Drops the entire file bucket with all of its contents- Parameters:
resultHandler- called when the bucket is dropped- Returns:
-
drop
public MongoGridFsClient drop()
Drops the entire file bucket with all of its contents- Returns:
-
rxDrop
public io.reactivex.Completable rxDrop()
Drops the entire file bucket with all of its contents- Returns:
-
findAllIds
public MongoGridFsClient findAllIds(Handler<AsyncResult<List<String>>> resultHandler)
Finds all file ids in the bucket- Parameters:
resultHandler- called when the list of file ids is available- Returns:
-
findAllIds
public MongoGridFsClient findAllIds()
Finds all file ids in the bucket- Returns:
-
rxFindAllIds
public io.reactivex.Single<List<String>> rxFindAllIds()
Finds all file ids in the bucket- Returns:
-
findIds
public MongoGridFsClient findIds(JsonObject query, Handler<AsyncResult<List<String>>> resultHandler)
Finds all file ids that match a query.- Parameters:
query- a bson query expressed as json that will be used to match filesresultHandler- called when the list of file ids is available- Returns:
-
findIds
public MongoGridFsClient findIds(JsonObject query)
Finds all file ids that match a query.- Parameters:
query- a bson query expressed as json that will be used to match files- Returns:
-
rxFindIds
public io.reactivex.Single<List<String>> rxFindIds(JsonObject query)
Finds all file ids that match a query.- Parameters:
query- a bson query expressed as json that will be used to match files- Returns:
-
uploadByFileName
public MongoGridFsClient uploadByFileName(ReadStream<Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler)
-
uploadByFileName
public MongoGridFsClient uploadByFileName(ReadStream<Buffer> stream, String fileName)
-
rxUploadByFileName
public io.reactivex.Single<String> rxUploadByFileName(ReadStream<Buffer> stream, String fileName)
-
uploadByFileName
public MongoGridFsClient uploadByFileName(io.reactivex.Flowable<Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler)
-
uploadByFileName
public MongoGridFsClient uploadByFileName(io.reactivex.Flowable<Buffer> stream, String fileName)
-
rxUploadByFileName
public io.reactivex.Single<String> rxUploadByFileName(io.reactivex.Flowable<Buffer> stream, String fileName)
-
uploadByFileNameWithOptions
public MongoGridFsClient uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)
-
uploadByFileNameWithOptions
public MongoGridFsClient uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options)
-
rxUploadByFileNameWithOptions
public io.reactivex.Single<String> rxUploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options)
-
uploadByFileNameWithOptions
public MongoGridFsClient uploadByFileNameWithOptions(io.reactivex.Flowable<Buffer> stream, String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)
-
uploadByFileNameWithOptions
public MongoGridFsClient uploadByFileNameWithOptions(io.reactivex.Flowable<Buffer> stream, String fileName, GridFsUploadOptions options)
-
rxUploadByFileNameWithOptions
public io.reactivex.Single<String> rxUploadByFileNameWithOptions(io.reactivex.Flowable<Buffer> stream, String fileName, GridFsUploadOptions options)
-
uploadFile
public MongoGridFsClient uploadFile(String fileName, Handler<AsyncResult<String>> resultHandler)
Upload a file to gridfs- Parameters:
fileName- the name of the file to store in gridfsresultHandler- the id of the file that was uploaded- Returns:
-
uploadFile
public MongoGridFsClient uploadFile(String fileName)
Upload a file to gridfs- Parameters:
fileName- the name of the file to store in gridfs- Returns:
-
rxUploadFile
public io.reactivex.Single<String> rxUploadFile(String fileName)
Upload a file to gridfs- Parameters:
fileName- the name of the file to store in gridfs- Returns:
-
uploadFileWithOptions
public MongoGridFsClient uploadFileWithOptions(String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)
Upload a file to gridfs with options- Parameters:
fileName- the name of the file to store in gridfsoptions-GridFsUploadOptionsfor specifying metadata and chunk sizeresultHandler- the id of the file that was uploaded- Returns:
-
uploadFileWithOptions
public MongoGridFsClient uploadFileWithOptions(String fileName, GridFsUploadOptions options)
Upload a file to gridfs with options- Parameters:
fileName- the name of the file to store in gridfsoptions-GridFsUploadOptionsfor specifying metadata and chunk size- Returns:
-
rxUploadFileWithOptions
public io.reactivex.Single<String> rxUploadFileWithOptions(String fileName, GridFsUploadOptions options)
Upload a file to gridfs with options- Parameters:
fileName- the name of the file to store in gridfsoptions-GridFsUploadOptionsfor specifying metadata and chunk size- Returns:
-
close
public void close()
Close the client and release its resources
-
newInstance
public static MongoGridFsClient newInstance(MongoGridFsClient arg)
-
-