Class GridFs

java.lang.Object
org.restheart.mongodb.db.GridFs

public class GridFs extends Object
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • Method Details

    • get

      public static GridFs 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 options
      dbName - the database name
      bucketName -
      metadata -
      fileInputStream -
      Returns:
      the OperationResult
      Throws:
      IOException
      com.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 options
      dbName - the database name
      bucketName -
      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 options
      dbName - the database name
      bucketName -
      fileId -
      filter -
      requestEtag -
      checkEtag -
      Returns:
      the OperationResult
    • deleteChunksCollection

      public void deleteChunksCollection(Optional<RSOps> rsOps, String dbName, String bucketName)
      Parameters:
      rsOps - the ReplicaSet connection options
      dbName - the database name
      bucketName -
    • 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 session
      rsOps - the ReplicaSet connection options
      dbName - the database name
      method - the request method
      collName -
      documentId -
      filter -
      shardKeys -
      newContent -
      requestEtag -
      checkEtag -
      Returns:
    • extractBucketName

      public static String extractBucketName(String collectionName)