Class GridFSUploadOptions


  • public class GridFSUploadOptions
    extends java.lang.Object
    GridFS upload options Customizable options used when uploading files into GridFS
    Since:
    3.1
    • Constructor Detail

      • GridFSUploadOptions

        public GridFSUploadOptions()
      • GridFSUploadOptions

        public GridFSUploadOptions​(JsonObject json)
    • Method Detail

      • setChunkSizeBytes

        public GridFSUploadOptions setChunkSizeBytes​(java.lang.Integer chunkSizeBytes)
        Sets the chunk size in bytes.
        Parameters:
        chunkSizeBytes - the number of bytes per chunk for the uploaded file
        Returns:
        this
      • getChunkSizeBytes

        public java.lang.Integer 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
      • setMetadata

        public GridFSUploadOptions setMetadata​(JsonObject metadata)
        Sets metadata to stored alongside the filename in the files collection
        Parameters:
        metadata - the metadata to be stored
        Returns:
        this
      • getMetadata

        public JsonObject 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