From 1a3b9e3c42c0f4eac78fcdfbca151dde997d96cf Mon Sep 17 00:00:00 2001 From: Niklas Helge Hanft Date: Fri, 6 Jul 2018 09:23:31 +0200 Subject: [PATCH] DATAMONGO-2021 - Use getObjectId() instead of getFilename() for opening the GridFS download stream. Using the file name leads to duplicate resource streams as file names are not unique therefore we're using the file's ObjectId to lookup the file content. Original pull request: #581. --- .../springframework/data/mongodb/gridfs/GridFsTemplate.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java index e5c353fbc..8d4beeaf3 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java @@ -44,7 +44,7 @@ import com.mongodb.client.gridfs.model.GridFSUploadOptions; /** * {@link GridFsOperations} implementation to store content into MongoDB GridFS. - * + * * @author Oliver Gierke * @author Philipp Schneider * @author Thomas Darimont @@ -62,7 +62,7 @@ public class GridFsTemplate implements GridFsOperations, ResourcePatternResolver /** * Creates a new {@link GridFsTemplate} using the given {@link MongoDbFactory} and {@link MongoConverter}. - * + * * @param dbFactory must not be {@literal null}. * @param converter must not be {@literal null}. */ @@ -72,7 +72,7 @@ public class GridFsTemplate implements GridFsOperations, ResourcePatternResolver /** * Creates a new {@link GridFsTemplate} using the given {@link MongoDbFactory} and {@link MongoConverter}. - * + * * @param dbFactory must not be {@literal null}. * @param converter must not be {@literal null}. * @param bucket