io.vertx.ext.mongo

## Interface MongoGridFsClient

-     public interface MongoGridFsClient

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the client and release its resources
    `Future<Void>` | `delete(String id)` Like `delete(String, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `delete(String id, Handler<AsyncResult<Void>> resultHandler)` Deletes a file by it's ID
    `Future<Long>` | `downloadByFileName(WriteStream<Buffer> stream, String fileName)` Like `downloadByFileName(WriteStream, String, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `downloadByFileName(WriteStream<Buffer> stream, String fileName, Handler<AsyncResult<Long>> resultHandler)`
    `Future<Long>` | `downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options)` Like `downloadByFileNameWithOptions(WriteStream, String, GridFsDownloadOptions, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options, Handler<AsyncResult<Long>> resultHandler)`
    `Future<Long>` | `downloadById(WriteStream<Buffer> stream, String id)` Like `downloadById(WriteStream, String, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `downloadById(WriteStream<Buffer> stream, String id, Handler<AsyncResult<Long>> resultHandler)`
    `Future<Long>` | `downloadFile(String fileName)` Like `downloadFile(String, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `downloadFile(String fileName, Handler<AsyncResult<Long>> resultHandler)` Downloads a file.
    `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, Handler<AsyncResult<Long>> resultHandler)` Downloads a file and gives it a new name.
    `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, Handler<AsyncResult<Long>> resultHandler)` Downloads a file using the ID generated by GridFs.
    `Future<Void>` | `drop()` Like `drop(Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `drop(Handler<AsyncResult<Void>> resultHandler)` Drops the entire file bucket with all of its contents
    `Future<List<String>>` | `findAllIds()` Like `findAllIds(Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `findAllIds(Handler<AsyncResult<List<String>>> resultHandler)` Finds all file ids in the bucket
    `Future<List<String>>` | `findIds(JsonObject query)` Like `findIds(JsonObject, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `findIds(JsonObject query, Handler<AsyncResult<List<String>>> resultHandler)` Finds all file ids that match a query.
    `ReadStream<Buffer>` | `readByFileName(String fileName)` Read file by name to ReadStream
    `ReadStream<Buffer>` | `readByFileNameWithOptions(String fileName, GridFsDownloadOptions options)` Read file by name to ReadStream with options
    `ReadStream<Buffer>` | `readById(String id)` Read file by id to ReadStream
    `Future<String>` | `uploadByFileName(ReadStream<Buffer> stream, String fileName)` Like `uploadByFileName(ReadStream, String, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `uploadByFileName(ReadStream<Buffer> stream, String fileName, Handler<AsyncResult<String>> resultHandler)`
    `Future<String>` | `uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options)` Like `uploadByFileNameWithOptions(ReadStream, String, GridFsUploadOptions, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options, Handler<AsyncResult<String>> resultHandler)`
    `Future<String>` | `uploadFile(String fileName)` Like `uploadFile(String, Handler)` but returns a `Future` of the asynchronous result
    `MongoGridFsClient` | `uploadFile(String fileName, Handler<AsyncResult<String>> resultHandler)` Upload a file to gridfs
    `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, Handler<AsyncResult<String>> resultHandler)` Upload a file to gridfs with options

- - ### Method Detail

    - #### delete

          MongoGridFsClient delete(String id,
                                   Handler<AsyncResult<Void>> resultHandler)

      Deletes a file by it's ID
      Parameters:
        `id` - the identifier of the file
        `resultHandler` - will be called when the file is deleted

    - #### delete

          Future<Void> delete(String id)

      Like `delete(String, Handler)` but returns a `Future` of the asynchronous result

    - #### readByFileName

          ReadStream<Buffer> readByFileName(String fileName)

      Read file by name to ReadStream

    - #### readByFileNameWithOptions

          ReadStream<Buffer> readByFileNameWithOptions(String fileName,
                                                       GridFsDownloadOptions options)

      Read file by name to ReadStream with options

    - #### readById

          ReadStream<Buffer> readById(String id)

      Read file by id to ReadStream

    - #### downloadByFileName

          MongoGridFsClient downloadByFileName(WriteStream<Buffer> stream,
                                               String fileName,
                                               Handler<AsyncResult<Long>> resultHandler)

    - #### downloadByFileName

          Future<Long> downloadByFileName(WriteStream<Buffer> stream,
                                          String fileName)

      Like `downloadByFileName(WriteStream, String, Handler)` but returns a `Future` of the asynchronous result

    - #### downloadByFileNameWithOptions

          MongoGridFsClient downloadByFileNameWithOptions(WriteStream<Buffer> stream,
                                                          String fileName,
                                                          GridFsDownloadOptions options,
                                                          Handler<AsyncResult<Long>> resultHandler)

    - #### downloadByFileNameWithOptions

          Future<Long> downloadByFileNameWithOptions(WriteStream<Buffer> stream,
                                                     String fileName,
                                                     GridFsDownloadOptions options)

      Like `downloadByFileNameWithOptions(WriteStream, String, GridFsDownloadOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### downloadById

          MongoGridFsClient downloadById(WriteStream<Buffer> stream,
                                         String id,
                                         Handler<AsyncResult<Long>> resultHandler)

    - #### downloadById

          Future<Long> downloadById(WriteStream<Buffer> stream,
                                    String id)

      Like `downloadById(WriteStream, String, Handler)` but returns a `Future` of the asynchronous result

    - #### downloadFile

          MongoGridFsClient downloadFile(String fileName,
                                         Handler<AsyncResult<Long>> resultHandler)

      Downloads a file.
      Parameters:
        `fileName` - the name of the file to download
        `resultHandler` - called when the file is downloaded and returns the length in bytes

    - #### downloadFile

          Future<Long> downloadFile(String fileName)

      Like `downloadFile(String, Handler)` but returns a `Future` of the asynchronous result

    - #### downloadFileAs

          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 download
        `newFileName` - the name the file should be saved as
        `resultHandler` - called when the file is downloaded and returns the length in bytes

    - #### downloadFileAs

          Future<Long> downloadFileAs(String fileName,
                                      String newFileName)

      Like `downloadFileAs(String, String, Handler)` but returns a `Future` of the asynchronous result

    - #### downloadFileByID

          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 download
        `resultHandler` - called when the file is downloaded and returns the length in bytes

    - #### downloadFileByID

          Future<Long> downloadFileByID(String id,
                                        String fileName)

      Like `downloadFileByID(String, String, Handler)` but returns a `Future` of the asynchronous result

    - #### drop

          MongoGridFsClient drop(Handler<AsyncResult<Void>> resultHandler)

      Drops the entire file bucket with all of its contents
      Parameters:
        `resultHandler` - called when the bucket is dropped

    - #### drop

          Future<Void> drop()

      Like `drop(Handler)` but returns a `Future` of the asynchronous result

    - #### findAllIds

          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

    - #### findAllIds

          Future<List<String>> findAllIds()

      Like `findAllIds(Handler)` but returns a `Future` of the asynchronous result

    - #### findIds

          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 files
        `resultHandler` - called when the list of file ids is available

    - #### findIds

          Future<List<String>> findIds(JsonObject query)

      Like `findIds(JsonObject, Handler)` but returns a `Future` of the asynchronous result

    - #### uploadByFileName

          MongoGridFsClient uploadByFileName(ReadStream<Buffer> stream,
                                             String fileName,
                                             Handler<AsyncResult<String>> resultHandler)

    - #### uploadByFileName

          Future<String> uploadByFileName(ReadStream<Buffer> stream,
                                          String fileName)

      Like `uploadByFileName(ReadStream, String, Handler)` but returns a `Future` of the asynchronous result

    - #### uploadByFileNameWithOptions

          MongoGridFsClient uploadByFileNameWithOptions(ReadStream<Buffer> stream,
                                                        String fileName,
                                                        GridFsUploadOptions options,
                                                        Handler<AsyncResult<String>> resultHandler)

    - #### uploadByFileNameWithOptions

          Future<String> uploadByFileNameWithOptions(ReadStream<Buffer> stream,
                                                     String fileName,
                                                     GridFsUploadOptions options)

      Like `uploadByFileNameWithOptions(ReadStream, String, GridFsUploadOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### uploadFile

          MongoGridFsClient uploadFile(String fileName,
                                       Handler<AsyncResult<String>> resultHandler)

      Upload a file to gridfs
      Parameters:
        `fileName` - the name of the file to store in gridfs
        `resultHandler` - the id of the file that was uploaded

    - #### uploadFile

          Future<String> uploadFile(String fileName)

      Like `uploadFile(String, Handler)` but returns a `Future` of the asynchronous result

    - #### uploadFileWithOptions

          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 gridfs
        `options` - `GridFsUploadOptions` for specifying metadata and chunk size
        `resultHandler` - the id of the file that was uploaded

    - #### uploadFileWithOptions

          Future<String> uploadFileWithOptions(String fileName,
                                               GridFsUploadOptions options)

      Like `uploadFileWithOptions(String, GridFsUploadOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### close

          void close()

      Close the client and release its resources

Copyright © 2024 Eclipse. All rights reserved.