java.lang.Object | ||
↳ | com.mongodb.gridfs.GridFSFile | |
↳ | com.mongodb.gridfs.GridFSInputFile |
This class represents a GridFS file to be written to the database Operations include: - writing data obtained from an InputStream - getting an OutputStream to stream the data out
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.mongodb.gridfs.GridFSFile
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
After retrieving this
OutputStream , this object will be
capable of accepting successively written data to the output stream. | |||||||||||
calls
save(long) with the existing chunk size
| |||||||||||
This method first calls saveChunks(long) if the file data has not been saved yet.
| |||||||||||
Saves all data into chunks from configured
InputStream input stream
to GridFS. | |||||||||||
Set the chunk size.
| |||||||||||
Sets the content type (MIME type) on the GridFS entry.
| |||||||||||
Sets the file name on the GridFS entry.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.mongodb.gridfs.GridFSFile
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.mongodb.DBObject
| |||||||||||
From interface
org.bson.BSONObject
|
After retrieving this OutputStream
, this object will be
capable of accepting successively written data to the output stream.
To completely persist this GridFS object, you must finally call the close()
method on the output stream. Note that calling the save() and saveChunks()
methods will throw Exceptions once you obtained the OutputStream.
This method first calls saveChunks(long) if the file data has not been saved yet. Then it persists the file entry to GridFS.
chunkSize | Size of chunks for file in bytes. |
---|
Saves all data into chunks from configured InputStream
input stream
to GridFS. A non-default chunk size can be specified.
This method does NOT save the file object itself, one must call save() to do so.
chunkSize | Size of chunks for file in bytes. |
---|
IOException | on problems reading the new entry's
InputStream .
|
---|
IOException | on problems reading the new entry's
InputStream .
|
---|
Set the chunk size. This must be called before saving any data.
Sets the content type (MIME type) on the GridFS entry.
ct | Content type. |
---|
Sets the file name on the GridFS entry.
fn | File name. |
---|