public interface MongoGridFsClient
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client and release its resources
|
io.vertx.core.Future<Void> |
delete(String id)
Like
delete(String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
delete(String id,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
Deletes a file by it's ID
|
io.vertx.core.Future<Long> |
downloadByFileName(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream,
String fileName)
Like
downloadByFileName(WriteStream, String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
downloadByFileName(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream,
String fileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler) |
io.vertx.core.Future<Long> |
downloadByFileNameWithOptions(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream,
String fileName,
GridFsDownloadOptions options)
Like
downloadByFileNameWithOptions(WriteStream, String, GridFsDownloadOptions, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
downloadByFileNameWithOptions(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream,
String fileName,
GridFsDownloadOptions options,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler) |
io.vertx.core.Future<Long> |
downloadById(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream,
String id)
Like
downloadById(WriteStream, String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
downloadById(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream,
String id,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler) |
io.vertx.core.Future<Long> |
downloadFile(String fileName)
Like
downloadFile(String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
downloadFile(String fileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
Downloads a file.
|
io.vertx.core.Future<Long> |
downloadFileAs(String fileName,
String newFileName)
Like
downloadFileAs(String, String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
downloadFileAs(String fileName,
String newFileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
Downloads a file and gives it a new name.
|
io.vertx.core.Future<Long> |
downloadFileByID(String id,
String fileName)
Like
downloadFileByID(String, String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
downloadFileByID(String id,
String fileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
Downloads a file using the ID generated by GridFs.
|
io.vertx.core.Future<Void> |
drop()
Like
drop(Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
drop(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
Drops the entire file bucket with all of its contents
|
io.vertx.core.Future<List<String>> |
findAllIds()
Like
findAllIds(Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
findAllIds(io.vertx.core.Handler<io.vertx.core.AsyncResult<List<String>>> resultHandler)
Finds all file ids in the bucket
|
io.vertx.core.Future<List<String>> |
findIds(io.vertx.core.json.JsonObject query)
Like
findIds(JsonObject, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
findIds(io.vertx.core.json.JsonObject query,
io.vertx.core.Handler<io.vertx.core.AsyncResult<List<String>>> resultHandler)
Finds all file ids that match a query.
|
io.vertx.core.Future<String> |
uploadByFileName(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream,
String fileName)
Like
uploadByFileName(ReadStream, String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
uploadByFileName(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream,
String fileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler) |
io.vertx.core.Future<String> |
uploadByFileNameWithOptions(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream,
String fileName,
GridFsUploadOptions options)
Like
uploadByFileNameWithOptions(ReadStream, String, GridFsUploadOptions, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
uploadByFileNameWithOptions(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream,
String fileName,
GridFsUploadOptions options,
io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler) |
io.vertx.core.Future<String> |
uploadFile(String fileName)
Like
uploadFile(String, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
uploadFile(String fileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
Upload a file to gridfs
|
io.vertx.core.Future<String> |
uploadFileWithOptions(String fileName,
GridFsUploadOptions options)
Like
uploadFileWithOptions(String, GridFsUploadOptions, Handler) but returns a Future of the asynchronous result |
MongoGridFsClient |
uploadFileWithOptions(String fileName,
GridFsUploadOptions options,
io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
Upload a file to gridfs with options
|
MongoGridFsClient delete(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
id
- the identifier of the fileresultHandler
- will be called when the file is deletedio.vertx.core.Future<Void> delete(String id)
delete(String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadByFileName(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream, String fileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
io.vertx.core.Future<Long> downloadByFileName(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream, String fileName)
downloadByFileName(WriteStream, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadByFileNameWithOptions(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream, String fileName, GridFsDownloadOptions options, io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
io.vertx.core.Future<Long> downloadByFileNameWithOptions(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream, String fileName, GridFsDownloadOptions options)
downloadByFileNameWithOptions(WriteStream, String, GridFsDownloadOptions, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadById(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream, String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
io.vertx.core.Future<Long> downloadById(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> stream, String id)
downloadById(WriteStream, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadFile(String fileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
fileName
- the name of the file to downloadresultHandler
- called when the file is downloaded and returns the length in bytesio.vertx.core.Future<Long> downloadFile(String fileName)
downloadFile(String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadFileAs(String fileName, String newFileName, io.vertx.core.Handler<io.vertx.core.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 bytesio.vertx.core.Future<Long> downloadFileAs(String fileName, String newFileName)
downloadFileAs(String, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient downloadFileByID(String id, String fileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Long>> resultHandler)
id
- the GridFs Object ID of the file to downloadresultHandler
- called when the file is downloaded and returns the length in bytesio.vertx.core.Future<Long> downloadFileByID(String id, String fileName)
downloadFileByID(String, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient drop(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
resultHandler
- called when the bucket is droppedio.vertx.core.Future<Void> drop()
drop(Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient findAllIds(io.vertx.core.Handler<io.vertx.core.AsyncResult<List<String>>> resultHandler)
resultHandler
- called when the list of file ids is availableio.vertx.core.Future<List<String>> findAllIds()
findAllIds(Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient findIds(io.vertx.core.json.JsonObject query, io.vertx.core.Handler<io.vertx.core.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 availableio.vertx.core.Future<List<String>> findIds(io.vertx.core.json.JsonObject query)
findIds(JsonObject, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadByFileName(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream, String fileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
io.vertx.core.Future<String> uploadByFileName(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream, String fileName)
uploadByFileName(ReadStream, String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadByFileNameWithOptions(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream, String fileName, GridFsUploadOptions options, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
io.vertx.core.Future<String> uploadByFileNameWithOptions(io.vertx.core.streams.ReadStream<io.vertx.core.buffer.Buffer> stream, String fileName, GridFsUploadOptions options)
uploadByFileNameWithOptions(ReadStream, String, GridFsUploadOptions, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadFile(String fileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> resultHandler)
fileName
- the name of the file to store in gridfsresultHandler
- the id of the file that was uploadedio.vertx.core.Future<String> uploadFile(String fileName)
uploadFile(String, Handler)
but returns a Future
of the asynchronous resultMongoGridFsClient uploadFileWithOptions(String fileName, GridFsUploadOptions options, io.vertx.core.Handler<io.vertx.core.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 uploadedio.vertx.core.Future<String> uploadFileWithOptions(String fileName, GridFsUploadOptions options)
uploadFileWithOptions(String, GridFsUploadOptions, Handler)
but returns a Future
of the asynchronous resultvoid close()
Copyright © 2020 Eclipse. All rights reserved.