public interface MongoGridFsClient
MongoGridFsClient delete(String id, Handler<AsyncResult<Void>> resultHandler)
id
- the identifier of the fileresultHandler
- will be called when the file is deletedFuture<Void> delete(String id)
delete(String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadByFileName(WriteStream<Buffer> stream, String fileName, Handler<AsyncResult<Long>> resultHandler)
Future<Long> downloadByFileName(WriteStream<Buffer> stream, String fileName)
downloadByFileName(WriteStream, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options, Handler<AsyncResult<Long>> resultHandler)
Future<Long> downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options)
downloadByFileNameWithOptions(WriteStream, String, GridFsDownloadOptions, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadById(WriteStream<Buffer> stream, String id, Handler<AsyncResult<Long>> resultHandler)
Future<Long> downloadById(WriteStream<Buffer> stream, String id)
downloadById(WriteStream, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadFile(String fileName, Handler<AsyncResult<Long>> resultHandler)
fileName
- the name of the file to downloadresultHandler
- called when the file is downloaded and returns the length in bytesFuture<Long> downloadFile(String fileName)
downloadFile(String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadFileAs(String fileName, String newFileName, Handler<AsyncResult<Long>> resultHandler)
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 bytesFuture<Long> downloadFileAs(String fileName, String newFileName)
downloadFileAs(String, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadFileByID(String id, String fileName, Handler<AsyncResult<Long>> resultHandler)
id
- the GridFs Object ID of the file to downloadresultHandler
- called when the file is downloaded and returns the length in bytesFuture<Long> downloadFileByID(String id, String fileName)
downloadFileByID(String, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient drop(Handler<AsyncResult<Void>> resultHandler)
resultHandler
- called when the bucket is droppedFuture<Void> drop()
drop(Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient findAllIds(Handler<AsyncResult<List<String>>> resultHandler)
resultHandler
- called when the list of file ids is availableFuture<List<String>> findAllIds()
findAllIds(Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient findIds(JsonObject query, Handler<AsyncResult<List<String>>> resultHandler)
query
- a bson query expressed as json that will be used to match filesresultHandler
- called when the list of file ids is availableFuture<List<String>> findIds(JsonObject query)
findIds(JsonObject, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadByFileName(ReadStream<Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler)
Future<String> uploadByFileName(ReadStream<Buffer> stream, String fileName)
uploadByFileName(ReadStream, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)
Future<String> uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options)
uploadByFileNameWithOptions(ReadStream, String, GridFsUploadOptions, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadFile(String fileName, Handler<AsyncResult<String>> resultHandler)
fileName
- the name of the file to store in gridfsresultHandler
- the id of the file that was uploadedFuture<String> uploadFile(String fileName)
uploadFile(String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadFileWithOptions(String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)
fileName
- the name of the file to store in gridfsoptions
- GridFsUploadOptions
for specifying metadata and chunk sizeresultHandler
- the id of the file that was uploadedFuture<String> uploadFileWithOptions(String fileName, GridFsUploadOptions options)
uploadFileWithOptions(String, GridFsUploadOptions, Handler)
but returns a Future
of the asynchronous resultvoid close()
Copyright © 2021 Eclipse. All rights reserved.