Package org.restheart.mongodb.db
Class GridFs
java.lang.Object
org.restheart.mongodb.db.GridFs
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Method Summary
Modifier and TypeMethodDescriptioncreateFile(Optional<RSOps> rsOps, String dbName, String bucketName, org.bson.BsonDocument metadata, InputStream fileInputStream) voiddeleteChunksCollection(Optional<RSOps> rsOps, String dbName, String bucketName) deleteFile(Optional<RSOps> rsOps, String dbName, String bucketName, org.bson.BsonValue fileId, org.bson.BsonDocument filter, String requestEtag, boolean checkEtag) static StringextractBucketName(String collectionName) static GridFsget()updateFileMetadata(Optional<com.mongodb.client.ClientSession> cs, Optional<RSOps> rsOps, String dbName, String collName, ExchangeKeys.METHOD method, Optional<org.bson.BsonValue> documentId, Optional<org.bson.BsonDocument> filter, Optional<org.bson.BsonDocument> shardKeys, org.bson.BsonDocument newContent, String requestEtag, boolean checkEtag) upsertFile(Optional<RSOps> rsOps, String dbName, String bucketName, org.bson.BsonDocument metadata, InputStream fileInputStream, org.bson.BsonDocument filter, String requestEtag, boolean checkEtag)
-
Method Details
-
get
-
createFile
public OperationResult createFile(Optional<RSOps> rsOps, String dbName, String bucketName, org.bson.BsonDocument metadata, InputStream fileInputStream) throws IOException, com.mongodb.DuplicateKeyException - Parameters:
rsOps- the ReplicaSet connection optionsdbName- the database namebucketName-metadata-fileInputStream-- Returns:
- the OperationResult
- Throws:
IOExceptioncom.mongodb.DuplicateKeyException
-
upsertFile
public OperationResult upsertFile(Optional<RSOps> rsOps, String dbName, String bucketName, org.bson.BsonDocument metadata, InputStream fileInputStream, org.bson.BsonDocument filter, String requestEtag, boolean checkEtag) throws IOException - Parameters:
rsOps- the ReplicaSet connection optionsdbName- the database namebucketName-metadata-fileInputStream-fileId-filter-requestEtag-checkEtag-- Returns:
- Throws:
IOException
-
deleteFile
public OperationResult deleteFile(Optional<RSOps> rsOps, String dbName, String bucketName, org.bson.BsonValue fileId, org.bson.BsonDocument filter, String requestEtag, boolean checkEtag) - Parameters:
rsOps- the ReplicaSet connection optionsdbName- the database namebucketName-fileId-filter-requestEtag-checkEtag-- Returns:
- the OperationResult
-
deleteChunksCollection
- Parameters:
rsOps- the ReplicaSet connection optionsdbName- the database namebucketName-
-
updateFileMetadata
public OperationResult updateFileMetadata(Optional<com.mongodb.client.ClientSession> cs, Optional<RSOps> rsOps, String dbName, String collName, ExchangeKeys.METHOD method, Optional<org.bson.BsonValue> documentId, Optional<org.bson.BsonDocument> filter, Optional<org.bson.BsonDocument> shardKeys, org.bson.BsonDocument newContent, String requestEtag, boolean checkEtag) - Parameters:
cs- the client sessionrsOps- the ReplicaSet connection optionsdbName- the database namemethod- the request methodcollName-documentId-filter-shardKeys-newContent-requestEtag-checkEtag-- Returns:
-
extractBucketName
-