Class GridFsUpload.GridFsUploadBuilder<T>
java.lang.Object
org.springframework.data.mongodb.gridfs.GridFsUpload.GridFsUploadBuilder<T>
- Type Parameters:
T
- the target id type.
- Enclosing class:
- GridFsUpload<ID>
Builder to create
GridFsUpload
in a fluent way.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
chunkSize
(int chunkSize) Set the upload chunk size in bytes.content
(InputStream stream) Define the content of the file to upload.content
(Supplier<InputStream> stream) Define the content of the file to upload.contentType
(String contentType) Set the content type.Set the filename.gridFsFile
(com.mongodb.client.gridfs.model.GridFSFile gridFSFile) Set id, filename, metadata and chunk size from given file.<T1> GridFsUpload.GridFsUploadBuilder<T1>
id
(T1 id) Set the id to use.metadata
(org.bson.Document metadata) Set the file metadata.options
(GridFsObject.Options options) Set additional file information.
-
Method Details
-
content
Define the content of the file to upload.- Parameters:
stream
- the upload content.- Returns:
- this.
-
content
Define the content of the file to upload.- Parameters:
stream
- the upload content.- Returns:
- this.
-
id
Set the id to use.- Type Parameters:
T1
-- Parameters:
id
- the id to save the content to.- Returns:
- this.
-
filename
Set the filename.- Parameters:
filename
- the filename to use.- Returns:
- this.
-
options
Set additional file information.- Parameters:
options
- must not be null.- Returns:
- this.
-
metadata
Set the file metadata.- Parameters:
metadata
- must not be null.- Returns:
- this.
-
chunkSize
Set the upload chunk size in bytes.- Parameters:
chunkSize
- use negative number for default.- Returns:
- this.
-
gridFsFile
public GridFsUpload.GridFsUploadBuilder<T> gridFsFile(com.mongodb.client.gridfs.model.GridFSFile gridFSFile) Set id, filename, metadata and chunk size from given file.- Parameters:
gridFSFile
- must not be null.- Returns:
- this.
-
contentType
Set the content type.- Parameters:
contentType
- must not be null.- Returns:
- this.
-
build
-