Package com.mongodb.client.gridfs.model
Class GridFSUploadOptions
java.lang.Object
com.mongodb.client.gridfs.model.GridFSUploadOptions
GridFS upload options
Customizable options used when uploading files into GridFS
- Since:
- 3.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchunkSizeBytes
(Integer chunkSizeBytes) Sets the chunk size in bytes.The number of bytes per chunk of this file.Returns any user provided data for the 'metadata' field of the files collection document.Sets metadata to stored alongside the filename in the files collection
-
Constructor Details
-
GridFSUploadOptions
public GridFSUploadOptions()Construct a new instance.
-
-
Method Details
-
getChunkSizeBytes
The number of bytes per chunk of this file.If no value has been set then, the chunkSizeBytes from the GridFSBucket will be used.
- Returns:
- number of bytes per chunk if set or null
-
chunkSizeBytes
Sets the chunk size in bytes.- Parameters:
chunkSizeBytes
- the number of bytes per chunk for the uploaded file- Returns:
- this
-
getMetadata
Returns any user provided data for the 'metadata' field of the files collection document.- Returns:
- the user provided metadata for the file if set or null
-
metadata
Sets metadata to stored alongside the filename in the files collection- Parameters:
metadata
- the metadata to be stored- Returns:
- this
-