Interface GridFSBucket
- Since:
- 3.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(ClientSession clientSession, BsonValue id) Deprecated.Given aid
, delete this stored file's files collection document and associated chunks from a GridFS bucket.void
delete
(ClientSession clientSession, ObjectId id) Deprecated.Given aid
, delete this stored file's files collection document and associated chunks from a GridFS bucket.void
Deprecated.Given aid
, delete this stored file's files collection document and associated chunks from a GridFS bucket.void
Deprecated.Given aid
, delete this stored file's files collection document and associated chunks from a GridFS bucket.void
downloadToStream
(ClientSession clientSession, String filename, OutputStream destination) Deprecated.Downloads the contents of the latest version of the stored file specified byfilename
and writes the contents to thedestination
Stream.void
downloadToStream
(ClientSession clientSession, String filename, OutputStream destination, GridFSDownloadOptions options) Deprecated.Downloads the contents of the stored file specified byfilename
and by the revision inoptions
and writes the contents to thedestination
Stream.void
downloadToStream
(ClientSession clientSession, BsonValue id, OutputStream destination) Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.void
downloadToStream
(ClientSession clientSession, ObjectId id, OutputStream destination) Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.void
downloadToStream
(String filename, OutputStream destination) Deprecated.Downloads the contents of the latest version of the stored file specified byfilename
and writes the contents to thedestination
Stream.void
downloadToStream
(String filename, OutputStream destination, GridFSDownloadOptions options) Deprecated.Downloads the contents of the stored file specified byfilename
and by the revision inoptions
and writes the contents to thedestination
Stream.void
downloadToStream
(BsonValue id, OutputStream destination) Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.void
downloadToStream
(ObjectId id, OutputStream destination) Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.void
downloadToStreamByName
(String filename, OutputStream destination) Deprecated.usedownloadToStream(String, OutputStream)
instead.void
downloadToStreamByName
(String filename, OutputStream destination, GridFSDownloadByNameOptions options) Deprecated.void
drop()
Deprecated.Drops the data associated with this bucket from the database.void
drop
(ClientSession clientSession) Deprecated.Drops the data associated with this bucket from the database.find()
Deprecated.Finds all documents in the files collection.find
(ClientSession clientSession) Deprecated.Finds all documents in the files collection.find
(ClientSession clientSession, Bson filter) Deprecated.Finds all documents in the collection that match the filter.Deprecated.Finds all documents in the collection that match the filter.Deprecated.The bucket name.int
Deprecated.Sets the chunk size in bytes.boolean
Deprecated.there is no replacement for this method, as MD5 is being removedDeprecated.Get the read concern for the GridFSBucket.Deprecated.Get the read preference for the GridFSBucket.Deprecated.Get the write concern for the GridFSBucket.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
.openDownloadStream
(ClientSession clientSession, String filename, GridFSDownloadOptions options) Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilename
and the revision inoptions
.openDownloadStream
(ClientSession clientSession, BsonValue id) Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byid
.openDownloadStream
(ClientSession clientSession, ObjectId id) Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byid
.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
.openDownloadStream
(String filename, GridFSDownloadOptions options) Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilename
and the revision inoptions
.Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byid
.Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byid
.openDownloadStreamByName
(String filename) Deprecated.useopenDownloadStream(String)
instead.openDownloadStreamByName
(String filename, GridFSDownloadByNameOptions options) Deprecated.useopenDownloadStream(String, GridFSDownloadOptions)
instead.openUploadStream
(ClientSession clientSession, String filename) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(ClientSession clientSession, String filename, GridFSUploadOptions options) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(ClientSession clientSession, BsonValue id, String filename) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(ClientSession clientSession, BsonValue id, String filename, GridFSUploadOptions options) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(ClientSession clientSession, ObjectId id, String filename) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(String filename) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(String filename, GridFSUploadOptions options) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(BsonValue id, String filename) Deprecated.Opens a Stream that the application can write the contents of the file to.openUploadStream
(BsonValue id, String filename, GridFSUploadOptions options) Deprecated.Opens a Stream that the application can write the contents of the file to.void
rename
(ClientSession clientSession, BsonValue id, String newFilename) Deprecated.Renames the stored file with the specifiedid
.void
rename
(ClientSession clientSession, ObjectId id, String newFilename) Deprecated.Renames the stored file with the specifiedid
.void
Deprecated.Renames the stored file with the specifiedid
.void
Deprecated.Renames the stored file with the specifiedid
.uploadFromStream
(ClientSession clientSession, String filename, InputStream source) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.uploadFromStream
(ClientSession clientSession, String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.void
uploadFromStream
(ClientSession clientSession, BsonValue id, String filename, InputStream source) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.void
uploadFromStream
(ClientSession clientSession, BsonValue id, String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.uploadFromStream
(String filename, InputStream source) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.uploadFromStream
(String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.void
uploadFromStream
(BsonValue id, String filename, InputStream source) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.void
uploadFromStream
(BsonValue id, String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.withChunkSizeBytes
(int chunkSizeBytes) Deprecated.Create a new GridFSBucket instance with a new chunk size in bytes.withDisableMD5
(boolean disableMD5) Deprecated.there is no replacement for this method, as MD5 is being removedwithReadConcern
(ReadConcern readConcern) Deprecated.Create a new GridFSBucket instance with a different read concern.withReadPreference
(ReadPreference readPreference) Deprecated.Create a new GridFSBucket instance with a different read preference.withWriteConcern
(WriteConcern writeConcern) Deprecated.Create a new GridFSBucket instance with a different write concern.
-
Method Details
-
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
- Since:
- 3.2
-
getDisableMD5
Deprecated.there is no replacement for this method, as MD5 is being removedReturns 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
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
Deprecated.Create a new GridFSBucket instance with a different read preference.- Parameters:
readPreference
- the newReadPreference
for the GridFSBucket- Returns:
- a new GridFSBucket instance with the different readPreference
-
withWriteConcern
Deprecated.Create a new GridFSBucket instance with a different write concern.- Parameters:
writeConcern
- the newWriteConcern
for the GridFSBucket- Returns:
- a new GridFSBucket instance with the different writeConcern
-
withReadConcern
Deprecated.Create a new GridFSBucket instance with a different read concern.- Parameters:
readConcern
- the newReadConcern
for the GridFSBucket- Returns:
- a new GridFSBucket instance with the different ReadConcern
- Since:
- 3.2
-
withDisableMD5
Deprecated.there is no replacement for this method, as MD5 is being removedCreate 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
Deprecated.Opens a Stream 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
Deprecated.Opens a Stream 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
Deprecated.Opens a Stream 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.
- Since:
- 3.3
-
openUploadStream
Deprecated.Opens a Stream 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 includes the _id for the file to be uploaded and the Stream to which the application will write the contents.
- Since:
- 3.3
-
openUploadStream
Deprecated.Opens a Stream 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
-
openUploadStream
GridFSUploadStream openUploadStream(ClientSession clientSession, String filename, GridFSUploadOptions options) Deprecated.Opens a Stream 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
-
openUploadStream
Deprecated.Opens a Stream 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
-
openUploadStream
Deprecated.Opens a Stream 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
-
openUploadStream
GridFSUploadStream openUploadStream(ClientSession clientSession, BsonValue id, String filename, GridFSUploadOptions options) Deprecated.Opens a Stream 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 includes the _id for the file to be uploaded and the Stream to which the application will write the contents.
- Since:
- 3.6
-
uploadFromStream
Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
in the files collection.- Parameters:
filename
- the filename for the streamsource
- the Stream providing the file data- Returns:
- the ObjectId of the uploaded file.
-
uploadFromStream
Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
in the files collection.- Parameters:
filename
- the filename for the streamsource
- the Stream providing the file dataoptions
- the GridFSUploadOptions- Returns:
- the ObjectId of the uploaded file.
-
uploadFromStream
Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
in the files collection.- Parameters:
id
- the custom id value of the filefilename
- the filename for the streamsource
- the Stream providing the file data- Since:
- 3.3
-
uploadFromStream
void uploadFromStream(BsonValue id, String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
in the files collection.- Parameters:
id
- the custom id value of the filefilename
- the filename for the streamsource
- the Stream providing the file dataoptions
- the GridFSUploadOptions- Since:
- 3.3
-
uploadFromStream
Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
in the files collection.- Parameters:
clientSession
- the client session with which to associate this operationfilename
- the filename for the streamsource
- the Stream providing the file data- Returns:
- the ObjectId of the uploaded file.
- Since:
- 3.6
-
uploadFromStream
ObjectId uploadFromStream(ClientSession clientSession, String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
in 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 GridFSUploadOptions- Returns:
- the ObjectId of the uploaded file.
- Since:
- 3.6
-
uploadFromStream
void uploadFromStream(ClientSession clientSession, BsonValue id, String filename, InputStream source) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
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 streamsource
- the Stream providing the file data- Since:
- 3.6
-
uploadFromStream
void uploadFromStream(ClientSession clientSession, BsonValue id, String filename, InputStream source, GridFSUploadOptions options) Deprecated.Uploads the contents of the givenInputStream
to a GridFS bucket.Reads the contents of the user file from the
Stream
and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document forfilename
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 streamsource
- the Stream providing the file dataoptions
- the GridFSUploadOptions- Since:
- 3.6
-
openDownloadStream
Deprecated.Opens a Stream 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
Deprecated.Opens a Stream 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
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
- Since:
- 3.3
-
openDownloadStream
Deprecated.Opens a Stream from which the application can read the contents of the stored file specified byfilename
and the revision inoptions
.- Parameters:
filename
- the name of the file to be downloadedoptions
- the download options- Returns:
- the stream
- Since:
- 3.3
-
openDownloadStream
Deprecated.Opens a Stream 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
-
openDownloadStream
Deprecated.Opens a Stream 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
-
openDownloadStream
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
-
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 byfilename
and 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
-
downloadToStream
Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.- Parameters:
id
- the ObjectId of the file to be written to the destination streamdestination
- the destination stream
-
downloadToStream
Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.- Parameters:
id
- the custom id of the file, to be written to the destination streamdestination
- the destination stream
-
downloadToStream
Deprecated.Downloads the contents of the latest version of the stored file specified byfilename
and writes the contents to thedestination
Stream.- Parameters:
filename
- the name of the file to be downloadeddestination
- the destination stream- Since:
- 3.3
-
downloadToStream
Deprecated.Downloads the contents of the stored file specified byfilename
and by the revision inoptions
and writes the contents to thedestination
Stream.- Parameters:
filename
- the name of the file to be downloadeddestination
- the destination streamoptions
- the download options- Since:
- 3.3
-
downloadToStream
Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.- 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 stream- Since:
- 3.6
-
downloadToStream
Deprecated.Downloads the contents of the stored file specified byid
and writes the contents to thedestination
Stream.- 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 stream- Since:
- 3.6
-
downloadToStream
Deprecated.Downloads the contents of the latest version of the stored file specified byfilename
and writes the contents to thedestination
Stream.- Parameters:
clientSession
- the client session with which to associate this operationfilename
- the name of the file to be downloadeddestination
- the destination stream- Since:
- 3.6
-
downloadToStream
void downloadToStream(ClientSession clientSession, String filename, OutputStream destination, GridFSDownloadOptions options) Deprecated.Downloads the contents of the stored file specified byfilename
and by the revision inoptions
and writes the contents to thedestination
Stream.- Parameters:
clientSession
- the client session with which to associate this operationfilename
- the name of the file to be downloadeddestination
- the destination streamoptions
- the download options- Since:
- 3.6
-
find
GridFSFindIterable find()Deprecated.Finds all documents in the files collection.- Returns:
- the GridFS find iterable interface
-
find
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:
-
find
Deprecated.Finds all documents in the files collection.- Parameters:
clientSession
- the client session with which to associate this operation- Returns:
- the GridFS find iterable interface
- Since:
- 3.6
-
find
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:
clientSession
- the client session with which to associate this operationfilter
- the query filter- Returns:
- the GridFS find iterable interface
- Since:
- 3.6
- See Also:
-
delete
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 deleted
-
delete
Deprecated.Given aid
, delete this stored file's files collection document and associated chunks from a GridFS bucket.- Parameters:
id
- the id of the file to be deleted- Since:
- 3.3
-
delete
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 deleted- Since:
- 3.6
-
delete
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 id of the file to be deleted- Since:
- 3.6
-
rename
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 file
-
rename
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 file- Since:
- 3.3
-
rename
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 file- Since:
- 3.6
-
rename
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 file- Since:
- 3.6
-
drop
void drop()Deprecated.Drops the data associated with this bucket from the database. -
drop
Deprecated.Drops the data associated with this bucket from the database.- Parameters:
clientSession
- the client session with which to associate this operation- Since:
- 3.6
-
openDownloadStreamByName
Deprecated.useopenDownloadStream(String)
instead.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
-
openDownloadStreamByName
@Deprecated GridFSDownloadStream openDownloadStreamByName(String filename, GridFSDownloadByNameOptions options) Deprecated.useopenDownloadStream(String, GridFSDownloadOptions)
instead.Opens a Stream from which the application can read the contents of the stored file specified byfilename
and the revision inoptions
.- Parameters:
filename
- the name of the file to be downloadedoptions
- the download options- Returns:
- the stream
-
downloadToStreamByName
Deprecated.usedownloadToStream(String, OutputStream)
instead.Downloads the contents of the latest version of the stored file specified byfilename
and writes the contents to thedestination
Stream.- Parameters:
filename
- the name of the file to be downloadeddestination
- the destination stream
-
downloadToStreamByName
@Deprecated void downloadToStreamByName(String filename, OutputStream destination, GridFSDownloadByNameOptions options) Deprecated.Downloads the contents of the stored file specified byfilename
and by the revision inoptions
and writes the contents to thedestination
Stream.- Parameters:
filename
- the name of the file to be downloadeddestination
- the destination streamoptions
- the download options
-