T - the target id type.public static class GridFsUpload.GridFsUploadBuilder<T> extends Object
GridFsUpload in a fluent way.| Modifier and Type | Method and Description |
|---|---|
GridFsUpload<T> |
build() |
GridFsUpload.GridFsUploadBuilder<T> |
chunkSize(int chunkSize)
Set the upload chunk size in bytes.
|
GridFsUpload.GridFsUploadBuilder<T> |
content(InputStream stream)
Define the content of the file to upload.
|
GridFsUpload.GridFsUploadBuilder<T> |
content(Supplier<InputStream> stream)
Define the content of the file to upload.
|
GridFsUpload.GridFsUploadBuilder<T> |
contentType(String contentType)
Set the content type.
|
GridFsUpload.GridFsUploadBuilder<T> |
filename(String filename)
Set the filename.
|
GridFsUpload.GridFsUploadBuilder<T> |
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.
|
GridFsUpload.GridFsUploadBuilder<T> |
metadata(org.bson.Document metadata)
Set the file metadata.
|
GridFsUpload.GridFsUploadBuilder<T> |
options(GridFsObject.Options options)
Set additional file information.
|
public GridFsUpload.GridFsUploadBuilder<T> content(InputStream stream)
stream - the upload content.public GridFsUpload.GridFsUploadBuilder<T> content(Supplier<InputStream> stream)
stream - the upload content.public <T1> GridFsUpload.GridFsUploadBuilder<T1> id(T1 id)
T1 - id - the id to save the content to.public GridFsUpload.GridFsUploadBuilder<T> filename(String filename)
filename - the filename to use.public GridFsUpload.GridFsUploadBuilder<T> options(GridFsObject.Options options)
options - must not be null.public GridFsUpload.GridFsUploadBuilder<T> metadata(org.bson.Document metadata)
metadata - must not be null.public GridFsUpload.GridFsUploadBuilder<T> chunkSize(int chunkSize)
chunkSize - use negative number for default.public GridFsUpload.GridFsUploadBuilder<T> gridFsFile(com.mongodb.client.gridfs.model.GridFSFile gridFSFile)
gridFSFile - must not be null.public GridFsUpload.GridFsUploadBuilder<T> contentType(String contentType)
contentType - must not be null.public GridFsUpload<T> build()
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.