Interface MongoGridFsClient
public interface MongoGridFsClient
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the client and release its resourcesDeletes a file by it's IDdownloadByFileName(WriteStream<Buffer> stream, String fileName) downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options) downloadById(WriteStream<Buffer> stream, String id) downloadFile(String fileName) Downloads a file.downloadFileAs(String fileName, String newFileName) Downloads a file and gives it a new name.downloadFileByID(String id, String fileName) Downloads a file using the ID generated by GridFs.drop()Drops the entire file bucket with all of its contentsFinds all file ids in the bucketfindIds(JsonObject query) Finds all file ids that match a query.readByFileName(String fileName) Read file by name to ReadStreamreadByFileNameWithOptions(String fileName, GridFsDownloadOptions options) Read file by name to ReadStream with optionsRead file by id to ReadStreamuploadByFileName(ReadStream<Buffer> stream, String fileName) uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options) uploadFile(String fileName) Upload a file to gridfsuploadFileWithOptions(String fileName, GridFsUploadOptions options) Upload a file to gridfs with options
-
Method Details
-
delete
-
readByFileName
Read file by name to ReadStream -
readByFileNameWithOptions
Read file by name to ReadStream with options -
readById
Read file by id to ReadStream -
downloadByFileName
-
downloadByFileNameWithOptions
Future<Long> downloadByFileNameWithOptions(WriteStream<Buffer> stream, String fileName, GridFsDownloadOptions options) -
downloadById
-
downloadFile
-
downloadFileAs
-
downloadFileByID
-
drop
-
findAllIds
-
findIds
Finds all file ids that match a query.- Parameters:
query- a bson query expressed as json that will be used to match files- Returns:
- a future notified with the result
-
uploadByFileName
-
uploadByFileNameWithOptions
Future<String> uploadByFileNameWithOptions(ReadStream<Buffer> stream, String fileName, GridFsUploadOptions options) -
uploadFile
-
uploadFileWithOptions
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:
- a future notified with the result
-
close
void close()Close the client and release its resources
-