public class GridFsTemplate extends Object implements GridFsOperations, ResourcePatternResolver
GridFsOperations implementation to store content into MongoDB GridFS.CLASSPATH_ALL_URL_PREFIXCLASSPATH_URL_PREFIX| Constructor and Description | 
|---|
| GridFsTemplate(MongoDbFactory dbFactory,
              MongoConverter converter) | 
| GridFsTemplate(MongoDbFactory dbFactory,
              MongoConverter converter,
              String bucket) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | delete(Query query)Deletes all files matching the given  Query. | 
| com.mongodb.client.gridfs.GridFSFindIterable | find(Query query)Returns all files matching the given query. | 
| com.mongodb.client.gridfs.model.GridFSFile | findOne(Query query)Returns a single file matching the given query or null in case no file matches. | 
| ClassLoader | getClassLoader() | 
| GridFsResource | getResource(String location)Returns all  GridFsResourcewith the given file name. | 
| GridFsResource[] | getResources(String locationPattern)Returns all  GridFsResources matching the given file name pattern. | 
| org.bson.types.ObjectId | store(InputStream content,
     org.bson.Document metadata)Stores the given content into a file with the given name. | 
| org.bson.types.ObjectId | store(InputStream content,
     Object metadata)Stores the given content into a file with the given name. | 
| org.bson.types.ObjectId | store(InputStream content,
     String filename)Stores the given content into a file with the given name. | 
| org.bson.types.ObjectId | store(InputStream content,
     String filename,
     org.bson.Document metadata)Stores the given content into a file with the given name using the given metadata. | 
| org.bson.types.ObjectId | store(InputStream content,
     String filename,
     Object metadata)Stores the given content into a file with the given name using the given metadata. | 
| org.bson.types.ObjectId | store(InputStream content,
     String filename,
     String contentType)Stores the given content into a file with the given name and content type. | 
| org.bson.types.ObjectId | store(InputStream content,
     String filename,
     String contentType,
     org.bson.Document metadata)Stores the given content into a file with the given name and content type using the given metadata. | 
| org.bson.types.ObjectId | store(InputStream content,
     String filename,
     String contentType,
     Object metadata)Stores the given content into a file with the given name and content type using the given metadata. | 
public GridFsTemplate(MongoDbFactory dbFactory, MongoConverter converter)
dbFactory - must not be null.converter - must not be null.public GridFsTemplate(MongoDbFactory dbFactory, MongoConverter converter, String bucket)
dbFactory - must not be null.converter - must not be null.bucket - public org.bson.types.ObjectId store(InputStream content, String filename)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.filename - must not be null or empty.GridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, Object metadata)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.metadata - can be null.GridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, org.bson.Document metadata)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.metadata - can be null.GridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, String filename, String contentType)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.filename - must not be null or empty.contentType - can be null.GridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, String filename, Object metadata)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.filename - must not be null or empty.metadata - can be null.GridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, String filename, String contentType, Object metadata)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.filename - must not be null or empty.contentType - can be null.metadata - can be nullGridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, String filename, org.bson.Document metadata)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.filename - must not be null or empty.metadata - can be null.GridFSFile just createdpublic org.bson.types.ObjectId store(InputStream content, String filename, String contentType, org.bson.Document metadata)
GridFsOperationsstore in interface GridFsOperationscontent - must not be null.filename - must not be null or empty.contentType - can be null.metadata - can be null.GridFSFile just createdpublic com.mongodb.client.gridfs.GridFSFindIterable find(Query query)
GridFsOperationsSort criterias defined at the
 Query will not be regarded as MongoDB does not support ordering for GridFS file access.find in interface GridFsOperationspublic com.mongodb.client.gridfs.model.GridFSFile findOne(Query query)
GridFsOperationsfindOne in interface GridFsOperationspublic void delete(Query query)
GridFsOperationsQuery.delete in interface GridFsOperationspublic ClassLoader getClassLoader()
getClassLoader in interface ResourceLoaderpublic GridFsResource getResource(String location)
GridFsOperationsGridFsResource with the given file name.getResource in interface ResourceLoadergetResource in interface GridFsOperationsResourceLoader.getResource(String)public GridFsResource[] getResources(String locationPattern)
GridFsOperationsGridFsResources matching the given file name pattern.getResources in interface ResourcePatternResolvergetResources in interface GridFsOperationsResourcePatternResolver.getResources(String)Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.