public interface GridFsOperations extends ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
CLASSPATH_URL_PREFIX
Modifier and Type | Method and Description |
---|---|
void |
delete(Query query)
Deletes all files matching the given
Query . |
List<GridFSDBFile> |
find(Query query)
Returns all files matching the given query.
|
GridFSDBFile |
findOne(Query query)
Returns a single file matching the given query or null in case no file matches.
|
GridFsResource |
getResource(String filename)
Returns all
GridFsResource with the given file name. |
GridFsResource[] |
getResources(String filenamePattern)
Returns all
GridFsResource s matching the given file name pattern. |
GridFSFile |
store(InputStream content,
String filename)
Stores the given content into a file with the given name.
|
GridFSFile |
store(InputStream content,
String filename,
DBObject metadata)
Stores the given content into a file with the given name using the given metadata.
|
GridFSFile |
store(InputStream content,
String filename,
Object metadata)
Stores the given content into a file with the given name using the given metadata.
|
getClassLoader
GridFSFile store(InputStream content, String filename)
content
- must not be null.filename
- must not be null or empty.GridFSFile
just createdGridFSFile store(InputStream content, String filename, Object metadata)
content
- must not be null.filename
- must not be null or empty.metadata
- GridFSFile
just createdGridFSFile store(InputStream content, String filename, DBObject metadata)
content
- must not be null.filename
- must not be null or empty.metadata
- must not be null.GridFSFile
just createdList<GridFSDBFile> find(Query query)
Sort
criterias defined at the
Query
will not be regarded as MongoDB does not support ordering for GridFS file access.query
- https://jira.mongodb.org/browse/JAVA-431
GridFSDBFile findOne(Query query)
query
- GridFsResource getResource(String filename)
GridFsResource
with the given file name.getResource
in interface ResourceLoader
filename
- ResourceLoader.getResource(String)
GridFsResource[] getResources(String filenamePattern)
GridFsResource
s matching the given file name pattern.getResources
in interface ResourcePatternResolver
filenamePattern
- ResourcePatternResolver.getResources(String)
Copyright © 2012. All Rights Reserved.