java.lang.Object | |
↳ | com.mongodb.gridfs.GridFS |
Implementation of GridFS v1.0 GridFS 1.0 spec
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_BUCKET | bucket to use for the collection namespaces | |||||||||
int | DEFAULT_CHUNKSIZE | file's chunk size | |||||||||
long | MAX_CHUNKSIZE | file's max chunk size |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_bucketName | |||||||||||
_chunkCollection | |||||||||||
_db | |||||||||||
_filesCollection |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a GridFS instance for the default bucket "fs"
in the given database.
| |||||||||||
Creates a GridFS instance for the specified bucket
in the given database.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
creates a file entry.
| |||||||||||
creates a file entry.
| |||||||||||
creates a file entry.
| |||||||||||
This method creates an empty
GridFSInputFile instance. | |||||||||||
creates a file entry.
| |||||||||||
creates a file entry.
| |||||||||||
creates a file entry.
| |||||||||||
finds one file matching the given id.
| |||||||||||
finds a list of files matching the given filename
| |||||||||||
finds a list of files matching the given query
| |||||||||||
finds one file matching the given id.
| |||||||||||
finds one file matching the given filename
| |||||||||||
finds one file matching the given query
| |||||||||||
gets the bucket name used in the collection's namespace
| |||||||||||
gets the db used
| |||||||||||
gets the list of files stored in this gridfs, sorted by filename
| |||||||||||
gets a filtered list of files stored in this gridfs, sorted by filename
| |||||||||||
removes all files matching the given query
| |||||||||||
removes the file matching the given id
| |||||||||||
removes all files matching the given filename
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
bucket to use for the collection namespaces
file's chunk size
file's max chunk size
Creates a GridFS instance for the default bucket "fs" in the given database. Set the preferred WriteConcern on the give DB with DB.setWriteConcern
db | database to work with |
---|
Creates a GridFS instance for the specified bucket in the given database. Set the preferred WriteConcern on the give DB with DB.setWriteConcern
db | database to work with |
---|---|
bucket | bucket to use in the given database |
creates a file entry. After calling this method, you have to call save() on the GridFSInputFile file
data | the file's data |
---|
creates a file entry. after calling this method, you have to call save() on the GridFSInputFile file
in | an inputstream containing the file's data |
---|---|
closeStreamOnPersist | indicate the passed in input stream should be closed once the data chunk persisted |
creates a file entry. after calling this method, you have to call save() on the GridFSInputFile file
in | an inputstream containing the file's data |
---|
This method creates an empty GridFSInputFile
instance. On this
instance an OutputStream
can be obtained using the
getOutputStream()
method. You can still call
setContentType(String)
and
setFilename(String)
. The file will be completely
written and closed after calling the close()
method on the output stream.
creates a file entry. After calling this method, you have to call save() on the GridFSInputFile file@return
f | the file object |
---|
IOException |
---|
creates a file entry. After calling this method, you have to call save() on the GridFSInputFile file
in | an inputstream containing the file's data |
---|---|
filename | the file name as stored in the db |
closeStreamOnPersist | indicate the passed in input stream should be closed once the data chunk persisted |
filename | the file name as stored in the db |
---|
creates a file entry. After calling this method, you have to call save() on the GridFSInputFile file
in | an inputstream containing the file's data |
---|---|
filename | the file name as stored in the db |
finds one file matching the given id. Equivalent to findOne(id)
gets the list of files stored in this gridfs, sorted by filename
gets a filtered list of files stored in this gridfs, sorted by filename
query | filter to apply |
---|