Class GridFsUpload<ID>
java.lang.Object
org.springframework.data.mongodb.gridfs.GridFsUpload<ID>
- All Implemented Interfaces:
GridFsObject<ID,
InputStream>
Upload descriptor for a GridFS file upload.
- Since:
- 3.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.gridfs.GridFsObject
GridFsObject.Options
-
Method Summary
Modifier and TypeMethodDescriptionstatic GridFsUpload.GridFsUploadBuilder<org.bson.types.ObjectId>
fromStream
(InputStream stream) Create a new instance ofGridFsUpload
for the givenInputStream
.The actual file content.TheGridFSFile.getId()
value converted into its simple java type.The filename.Additional information like file metadata (eg. contentType).
-
Method Details
-
getFileId
TheGridFSFile.getId()
value converted into its simple java type.
ABsonString
will be converted to plainString
.- Specified by:
getFileId
in interfaceGridFsObject<ID,
InputStream> - Returns:
- can be null.
- See Also:
-
getFilename
Description copied from interface:GridFsObject
The filename.- Specified by:
getFilename
in interfaceGridFsObject<ID,
InputStream> - Returns:
-
getContent
Description copied from interface:GridFsObject
The actual file content.- Specified by:
getContent
in interfaceGridFsObject<ID,
InputStream> - Returns:
-
getOptions
Description copied from interface:GridFsObject
Additional information like file metadata (eg. contentType).- Specified by:
getOptions
in interfaceGridFsObject<ID,
InputStream> - Returns:
- never null.
-
fromStream
public static GridFsUpload.GridFsUploadBuilder<org.bson.types.ObjectId> fromStream(InputStream stream) Create a new instance ofGridFsUpload
for the givenInputStream
.- Parameters:
stream
- must not be null.- Returns:
- new instance of
GridFsUpload
.
-