Interface GridFSBucket
-
Deprecated.Prefer the Reactive Streams-based asynchronous driver (mongodb-driver-reactivestreams artifactId)
@ThreadSafe @Deprecated public interface GridFSBucket
Represents a GridFS Bucket- Since:
- 3.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddelete(ClientSession clientSession, BsonValue id, SingleResultCallback<Void> callback)Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.voiddelete(ClientSession clientSession, ObjectId id, SingleResultCallback<Void> callback)Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.voiddelete(BsonValue id, SingleResultCallback<Void> callback)Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.voiddelete(ObjectId id, SingleResultCallback<Void> callback)Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.voiddownloadToStream(ClientSession clientSession, String filename, AsyncOutputStream destination, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the latest version of the stored file specified byfilenameand writes the contents to thedestinationStream.voiddownloadToStream(ClientSession clientSession, String filename, AsyncOutputStream destination, GridFSDownloadOptions options, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the stored file specified byfilenameand by the revision inoptionsand writes the contents to thedestinationStream.voiddownloadToStream(ClientSession clientSession, BsonValue id, AsyncOutputStream destination, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.voiddownloadToStream(ClientSession clientSession, ObjectId id, AsyncOutputStream destination, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.voiddownloadToStream(String filename, AsyncOutputStream destination, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the latest version of the stored file specified byfilenameand writes the contents to thedestinationStream.voiddownloadToStream(String filename, AsyncOutputStream destination, GridFSDownloadOptions options, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the stored file specified byfilenameand by the revision inoptionsand writes the contents to thedestinationStream.voiddownloadToStream(BsonValue id, AsyncOutputStream destination, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.voiddownloadToStream(ObjectId id, AsyncOutputStream destination, SingleResultCallback<Long> callback)Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.voiddrop(ClientSession clientSession, SingleResultCallback<Void> callback)Deprecated.Drops the data associated with this bucket from the database.voiddrop(SingleResultCallback<Void> callback)Deprecated.Drops the data associated with this bucket from the database.GridFSFindIterablefind()Deprecated.Finds all documents in the files collection.GridFSFindIterablefind(ClientSession clientSession)Deprecated.Finds all documents in the files collection.GridFSFindIterablefind(ClientSession clientSession, Bson filter)Deprecated.Finds all documents in the collection that match the filter.GridFSFindIterablefind(Bson filter)Deprecated.Finds all documents in the collection that match the filter.StringgetBucketName()Deprecated.The bucket name.intgetChunkSizeBytes()Deprecated.Sets the chunk size in bytes.booleangetDisableMD5()Deprecated.Returns true if computing MD5 checksums when uploading files is disabled.ReadConcerngetReadConcern()Deprecated.Get the read concern for the GridFSBucket.ReadPreferencegetReadPreference()Deprecated.Get the read preference for the GridFSBucket.WriteConcerngetWriteConcern()Deprecated.Get the write concern for the GridFSBucket.GridFSDownloadStreamopenDownloadStream(ClientSession clientSession, String filename)Deprecated.Opens a Stream from which the application can read the contents of the latest version of the stored file specified by thefilename.GridFSDownloadStreamopenDownloadStream(ClientSession clientSession, String filename, GridFSDownloadOptions options)Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilenameand the revision inoptions.GridFSDownloadStreamopenDownloadStream(ClientSession clientSession, BsonValue id)Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.GridFSDownloadStreamopenDownloadStream(ClientSession clientSession, ObjectId id)Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.GridFSDownloadStreamopenDownloadStream(String filename)Deprecated.Opens a Stream from which the application can read the contents of the latest version of the stored file specified by thefilename.GridFSDownloadStreamopenDownloadStream(String filename, GridFSDownloadOptions options)Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilenameand the revision inoptions.GridFSDownloadStreamopenDownloadStream(BsonValue id)Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.GridFSDownloadStreamopenDownloadStream(ObjectId id)Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.GridFSUploadStreamopenUploadStream(ClientSession clientSession, String filename)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(ClientSession clientSession, String filename, GridFSUploadOptions options)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(ClientSession clientSession, BsonValue id, String filename)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(ClientSession clientSession, BsonValue id, String filename, GridFSUploadOptions options)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(String filename)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(String filename, GridFSUploadOptions options)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(BsonValue id, String filename)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.GridFSUploadStreamopenUploadStream(BsonValue id, String filename, GridFSUploadOptions options)Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.voidrename(ClientSession clientSession, BsonValue id, String newFilename, SingleResultCallback<Void> callback)Deprecated.Renames the stored file with the specifiedid.voidrename(ClientSession clientSession, ObjectId id, String newFilename, SingleResultCallback<Void> callback)Deprecated.Renames the stored file with the specifiedid.voidrename(BsonValue id, String newFilename, SingleResultCallback<Void> callback)Deprecated.Renames the stored file with the specifiedid.voidrename(ObjectId id, String newFilename, SingleResultCallback<Void> callback)Deprecated.Renames the stored file with the specifiedid.voiduploadFromStream(ClientSession clientSession, String filename, AsyncInputStream source, SingleResultCallback<ObjectId> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(ClientSession clientSession, String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<ObjectId> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(ClientSession clientSession, BsonValue id, String filename, AsyncInputStream source, SingleResultCallback<Void> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(ClientSession clientSession, BsonValue id, String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<Void> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(String filename, AsyncInputStream source, SingleResultCallback<ObjectId> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<ObjectId> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(BsonValue id, String filename, AsyncInputStream source, SingleResultCallback<Void> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.voiduploadFromStream(BsonValue id, String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<Void> callback)Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.GridFSBucketwithChunkSizeBytes(int chunkSizeBytes)Deprecated.Create a new GridFSBucket instance with a new chunk size in bytes.GridFSBucketwithDisableMD5(boolean disableMD5)Deprecated.Create a new GridFSBucket instance with the set disable MD5 value.GridFSBucketwithReadConcern(ReadConcern readConcern)Deprecated.Create a new MongoDatabase instance with a different read concern.GridFSBucketwithReadPreference(ReadPreference readPreference)Deprecated.Create a new GridFSBucket instance with a different read preference.GridFSBucketwithWriteConcern(WriteConcern writeConcern)Deprecated.Create a new GridFSBucket instance with a different write concern.
-
-
-
Method Detail
-
getBucketName
String getBucketName()
Deprecated.The bucket name.- Returns:
- the bucket name
-
getChunkSizeBytes
int getChunkSizeBytes()
Deprecated.Sets the chunk size in bytes. Defaults to 255.- Returns:
- the chunk size in bytes.
-
getWriteConcern
WriteConcern getWriteConcern()
Deprecated.Get the write concern for the GridFSBucket.- Returns:
- the
WriteConcern
-
getReadPreference
ReadPreference getReadPreference()
Deprecated.Get the read preference for the GridFSBucket.- Returns:
- the
ReadPreference
-
getReadConcern
ReadConcern getReadConcern()
Deprecated.Get the read concern for the GridFSBucket.- Returns:
- the
ReadConcern - MongoDB documentation
- Read Concern
- Since server release
- 3.2
-
getDisableMD5
boolean getDisableMD5()
Deprecated.Returns true if computing MD5 checksums when uploading files is disabled.- Returns:
- true if computing MD5 checksums when uploading files is disabled.
- Since:
- 3.8
-
withChunkSizeBytes
GridFSBucket withChunkSizeBytes(int chunkSizeBytes)
Deprecated.Create a new GridFSBucket instance with a new chunk size in bytes.- Parameters:
chunkSizeBytes- the new chunk size in bytes.- Returns:
- a new GridFSBucket instance with the different chunk size in bytes
-
withReadPreference
GridFSBucket withReadPreference(ReadPreference readPreference)
Deprecated.Create a new GridFSBucket instance with a different read preference.- Parameters:
readPreference- the newReadPreferencefor the database- Returns:
- a new GridFSBucket instance with the different readPreference
-
withWriteConcern
GridFSBucket withWriteConcern(WriteConcern writeConcern)
Deprecated.Create a new GridFSBucket instance with a different write concern.- Parameters:
writeConcern- the newWriteConcernfor the database- Returns:
- a new GridFSBucket instance with the different writeConcern
-
withReadConcern
GridFSBucket withReadConcern(ReadConcern readConcern)
Deprecated.Create a new MongoDatabase instance with a different read concern.- Parameters:
readConcern- the newReadConcernfor the database- Returns:
- a new GridFSBucket instance with the different ReadConcern
- MongoDB documentation
- Read Concern
- Since server release
- 3.2
-
withDisableMD5
GridFSBucket withDisableMD5(boolean disableMD5)
Deprecated.Create a new GridFSBucket instance with the set disable MD5 value.- Parameters:
disableMD5- true if computing MD5 checksums when uploading files should be disabled.- Returns:
- a new GridFSBucket instance with the new disable MD5 value.
- Since:
- 3.8
-
openUploadStream
GridFSUploadStream openUploadStream(String filename)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
filename- the filename for the stream- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
-
openUploadStream
GridFSUploadStream openUploadStream(String filename, GridFSUploadOptions options)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
filename- the filename for the streamoptions- the GridFSUploadOptions- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
-
openUploadStream
GridFSUploadStream openUploadStream(BsonValue id, String filename)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
id- the custom id value of the filefilename- the filename for the stream- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
-
openUploadStream
GridFSUploadStream openUploadStream(BsonValue id, String filename, GridFSUploadOptions options)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
id- the custom id value of the filefilename- the filename for the streamoptions- the GridFSUploadOptions- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
-
openUploadStream
GridFSUploadStream openUploadStream(ClientSession clientSession, String filename)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
clientSession- the client session with which to associate this operationfilename- the filename for the stream- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
- Since:
- 3.6
- Since server release
- 3.6
-
openUploadStream
GridFSUploadStream openUploadStream(ClientSession clientSession, String filename, GridFSUploadOptions options)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
clientSession- the client session with which to associate this operationfilename- the filename for the streamoptions- the GridFSUploadOptions- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
- Since:
- 3.6
- Since server release
- 3.6
-
openUploadStream
GridFSUploadStream openUploadStream(ClientSession clientSession, BsonValue id, String filename)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
clientSession- the client session with which to associate this operationid- the custom id value of the filefilename- the filename for the stream- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
- Since:
- 3.6
- Since server release
- 3.6
-
openUploadStream
GridFSUploadStream openUploadStream(ClientSession clientSession, BsonValue id, String filename, GridFSUploadOptions options)
Deprecated.Opens a AsyncOutputStream that the application can write the contents of the file to.As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
- Parameters:
clientSession- the client session with which to associate this operationid- the custom id value of the filefilename- the filename for the streamoptions- the GridFSUploadOptions- Returns:
- the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
- Since:
- 3.6
- Since server release
- 3.6
-
uploadFromStream
void uploadFromStream(String filename, AsyncInputStream source, SingleResultCallback<ObjectId> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
filename- the filename for the streamsource- the Stream providing the file datacallback- with the ObjectId of the uploaded file.
-
uploadFromStream
void uploadFromStream(String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<ObjectId> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
filename- the filename for the streamsource- the Stream providing the file dataoptions- the GridFSUploadOptionscallback- with the ObjectId of the uploaded file.
-
uploadFromStream
void uploadFromStream(BsonValue id, String filename, AsyncInputStream source, SingleResultCallback<Void> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
id- the custom id value of the filefilename- the filename for the streamsource- the Stream providing the file datacallback- with the ObjectId of the uploaded file.
-
uploadFromStream
void uploadFromStream(BsonValue id, String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<Void> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
id- the custom id value of the filefilename- the filename for the streamsource- the Stream providing the file dataoptions- the GridFSUploadOptionscallback- with the ObjectId of the uploaded file.
-
uploadFromStream
void uploadFromStream(ClientSession clientSession, String filename, AsyncInputStream source, SingleResultCallback<ObjectId> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
clientSession- the client session with which to associate this operationfilename- the filename for the streamsource- the Stream providing the file datacallback- with the ObjectId of the uploaded file.- Since:
- 3.6
- Since server release
- 3.6
-
uploadFromStream
void uploadFromStream(ClientSession clientSession, String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<ObjectId> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
clientSession- the client session with which to associate this operationfilename- the filename for the streamsource- the Stream providing the file dataoptions- the GridFSUploadOptionscallback- with the ObjectId of the uploaded file.- Since:
- 3.6
- Since server release
- 3.6
-
uploadFromStream
void uploadFromStream(ClientSession clientSession, BsonValue id, String filename, AsyncInputStream source, SingleResultCallback<Void> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
clientSession- the client session with which to associate this operationid- the custom id value of the filefilename- the filename for the streamsource- the Stream providing the file datacallback- with the ObjectId of the uploaded file.- Since:
- 3.6
- Since server release
- 3.6
-
uploadFromStream
void uploadFromStream(ClientSession clientSession, BsonValue id, String filename, AsyncInputStream source, GridFSUploadOptions options, SingleResultCallback<Void> callback)
Deprecated.Uploads the contents of the givenAsyncInputStreamto a GridFS bucket.Reads the contents of the user file from the
sourceand uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilenamein the files collection.- Parameters:
clientSession- the client session with which to associate this operationid- the custom id value of the filefilename- the filename for the streamsource- the Stream providing the file dataoptions- the GridFSUploadOptionscallback- with the ObjectId of the uploaded file.- Since:
- 3.6
- Since server release
- 3.6
-
openDownloadStream
GridFSDownloadStream openDownloadStream(ObjectId id)
Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.- Parameters:
id- the ObjectId of the file to be put into a stream.- Returns:
- the stream
-
openDownloadStream
GridFSDownloadStream openDownloadStream(BsonValue id)
Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.- Parameters:
id- the custom id value of the file, to be put into a stream.- Returns:
- the stream
-
openDownloadStream
GridFSDownloadStream openDownloadStream(String filename)
Deprecated.Opens a Stream from which the application can read the contents of the latest version of the stored file specified by thefilename.- Parameters:
filename- the name of the file to be downloaded- Returns:
- the stream
-
openDownloadStream
GridFSDownloadStream openDownloadStream(String filename, GridFSDownloadOptions options)
Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilenameand the revision inoptions.- Parameters:
filename- the name of the file to be downloadedoptions- the download options- Returns:
- the stream
-
openDownloadStream
GridFSDownloadStream openDownloadStream(ClientSession clientSession, ObjectId id)
Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.- Parameters:
clientSession- the client session with which to associate this operationid- the ObjectId of the file to be put into a stream.- Returns:
- the stream
- Since:
- 3.6
- Since server release
- 3.6
-
openDownloadStream
GridFSDownloadStream openDownloadStream(ClientSession clientSession, BsonValue id)
Deprecated.Opens a AsyncInputStream from which the application can read the contents of the stored file specified byid.- Parameters:
clientSession- the client session with which to associate this operationid- the custom id value of the file, to be put into a stream.- Returns:
- the stream
- Since:
- 3.6
- Since server release
- 3.6
-
openDownloadStream
GridFSDownloadStream openDownloadStream(ClientSession clientSession, String filename)
Deprecated.Opens a Stream from which the application can read the contents of the latest version of the stored file specified by thefilename.- Parameters:
clientSession- the client session with which to associate this operationfilename- the name of the file to be downloaded- Returns:
- the stream
- Since:
- 3.6
- Since server release
- 3.6
-
openDownloadStream
GridFSDownloadStream openDownloadStream(ClientSession clientSession, String filename, GridFSDownloadOptions options)
Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilenameand the revision inoptions.- Parameters:
clientSession- the client session with which to associate this operationfilename- the name of the file to be downloadedoptions- the download options- Returns:
- the stream
- Since:
- 3.6
- Since server release
- 3.6
-
downloadToStream
void downloadToStream(ObjectId id, AsyncOutputStream destination, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.- Parameters:
id- the ObjectId of the file to be written to the destination streamdestination- the destination streamcallback- the callback that is completed once the file has been downloaded
-
downloadToStream
void downloadToStream(BsonValue id, AsyncOutputStream destination, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.- Parameters:
id- the custom id of the file, to be written to the destination streamdestination- the destination streamcallback- the callback that is completed once the file has been downloaded
-
downloadToStream
void downloadToStream(String filename, AsyncOutputStream destination, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the latest version of the stored file specified byfilenameand writes the contents to thedestinationStream.- Parameters:
filename- the name of the file to be downloadeddestination- the destination streamcallback- the callback that is completed once the file has been downloaded
-
downloadToStream
void downloadToStream(String filename, AsyncOutputStream destination, GridFSDownloadOptions options, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the stored file specified byfilenameand by the revision inoptionsand writes the contents to thedestinationStream.- Parameters:
filename- the name of the file to be downloadeddestination- the destination streamoptions- the download optionscallback- the callback that is completed once the file has been downloaded
-
downloadToStream
void downloadToStream(ClientSession clientSession, ObjectId id, AsyncOutputStream destination, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.- Parameters:
clientSession- the client session with which to associate this operationid- the ObjectId of the file to be written to the destination streamdestination- the destination streamcallback- the callback that is completed once the file has been downloaded- Since:
- 3.6
- Since server release
- 3.6
-
downloadToStream
void downloadToStream(ClientSession clientSession, BsonValue id, AsyncOutputStream destination, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the stored file specified byidand writes the contents to thedestinationAsyncOutputStream.- Parameters:
clientSession- the client session with which to associate this operationid- the custom id of the file, to be written to the destination streamdestination- the destination streamcallback- the callback that is completed once the file has been downloaded- Since:
- 3.6
- Since server release
- 3.6
-
downloadToStream
void downloadToStream(ClientSession clientSession, String filename, AsyncOutputStream destination, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the latest version of the stored file specified byfilenameand writes the contents to thedestinationStream.- Parameters:
clientSession- the client session with which to associate this operationfilename- the name of the file to be downloadeddestination- the destination streamcallback- the callback that is completed once the file has been downloaded- Since:
- 3.6
- Since server release
- 3.6
-
downloadToStream
void downloadToStream(ClientSession clientSession, String filename, AsyncOutputStream destination, GridFSDownloadOptions options, SingleResultCallback<Long> callback)
Deprecated.Downloads the contents of the stored file specified byfilenameand by the revision inoptionsand writes the contents to thedestinationStream.- Parameters:
clientSession- the client session with which to associate this operationfilename- the name of the file to be downloadeddestination- the destination streamoptions- the download optionscallback- the callback that is completed once the file has been downloaded- Since:
- 3.6
- Since server release
- 3.6
-
find
GridFSFindIterable find()
Deprecated.Finds all documents in the files collection.- Returns:
- the GridFS find iterable interface
- MongoDB documentation
- Find
-
find
GridFSFindIterable find(Bson filter)
Deprecated.Finds all documents in the collection that match the filter.Below is an example of filtering against the filename and some nested metadata that can also be stored along with the file data:
Filters.and(Filters.eq("filename", "mongodb.png"), Filters.eq("metadata.contentType", "image/png"));- Parameters:
filter- the query filter- Returns:
- the GridFS find iterable interface
- See Also:
Filters
-
find
GridFSFindIterable find(ClientSession clientSession)
Deprecated.Finds all documents in the files collection.
-
find
GridFSFindIterable find(ClientSession clientSession, Bson filter)
Deprecated.Finds all documents in the collection that match the filter.Below is an example of filtering against the filename and some nested metadata that can also be stored along with the file data:
Filters.and(Filters.eq("filename", "mongodb.png"), Filters.eq("metadata.contentType", "image/png"));
-
delete
void delete(ObjectId id, SingleResultCallback<Void> callback)
Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.- Parameters:
id- the ObjectId of the file to be deletedcallback- the callback that is completed once the file has been deleted
-
delete
void delete(BsonValue id, SingleResultCallback<Void> callback)
Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.- Parameters:
id- the ObjectId of the file to be deletedcallback- the callback that is completed once the file has been deleted
-
delete
void delete(ClientSession clientSession, ObjectId id, SingleResultCallback<Void> callback)
Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.- Parameters:
clientSession- the client session with which to associate this operationid- the ObjectId of the file to be deletedcallback- the callback that is completed once the file has been deleted- Since:
- 3.6
- Since server release
- 3.6
-
delete
void delete(ClientSession clientSession, BsonValue id, SingleResultCallback<Void> callback)
Deprecated.Given aid, delete this stored file's files collection document and associated chunks from a GridFS bucket.- Parameters:
clientSession- the client session with which to associate this operationid- the ObjectId of the file to be deletedcallback- the callback that is completed once the file has been deleted- Since:
- 3.6
- Since server release
- 3.6
-
rename
void rename(ObjectId id, String newFilename, SingleResultCallback<Void> callback)
Deprecated.Renames the stored file with the specifiedid.- Parameters:
id- the id of the file in the files collection to renamenewFilename- the new filename for the filecallback- the callback that is completed once the file has been renamed
-
rename
void rename(BsonValue id, String newFilename, SingleResultCallback<Void> callback)
Deprecated.Renames the stored file with the specifiedid.- Parameters:
id- the id of the file in the files collection to renamenewFilename- the new filename for the filecallback- the callback that is completed once the file has been renamed
-
rename
void rename(ClientSession clientSession, ObjectId id, String newFilename, SingleResultCallback<Void> callback)
Deprecated.Renames the stored file with the specifiedid.- Parameters:
clientSession- the client session with which to associate this operationid- the id of the file in the files collection to renamenewFilename- the new filename for the filecallback- the callback that is completed once the file has been renamed- Since:
- 3.6
- Since server release
- 3.6
-
rename
void rename(ClientSession clientSession, BsonValue id, String newFilename, SingleResultCallback<Void> callback)
Deprecated.Renames the stored file with the specifiedid.- Parameters:
clientSession- the client session with which to associate this operationid- the id of the file in the files collection to renamenewFilename- the new filename for the filecallback- the callback that is completed once the file has been renamed- Since:
- 3.6
- Since server release
- 3.6
-
drop
void drop(SingleResultCallback<Void> callback)
Deprecated.Drops the data associated with this bucket from the database.- Parameters:
callback- the callback that is completed once the collection has been dropped
-
drop
void drop(ClientSession clientSession, SingleResultCallback<Void> callback)
Deprecated.Drops the data associated with this bucket from the database.- Parameters:
clientSession- the client session with which to associate this operationcallback- the callback that is completed once the collection has been dropped- Since:
- 3.6
- Since server release
- 3.6
-
-