code: private void saveGridFSFile(GridFSInputFile gfsInputFile, EntityMetadata m)
      {
          try
          {
              DBCollection coll = mongoDb.getCollection(m.getTableName() + MongoDBUtils.FILES);
              createUniqueIndexGFS(coll, ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName());
              gfsInputFile.save();
              log.info("Input GridFS file: " + gfsInputFile.getFilename() + " is saved successfully in "
                      + m.getTableName() + MongoDBUtils.CHUNKS + " and metadata in " + m.getTableName()
                      + MongoDBUtils.FILES);
          }
          catch (MongoException e)
          {
              log.error("Error in saving GridFS file in " + m.getTableName() + MongoDBUtils.FILES + " or "
                      + m.getTableName() + MongoDBUtils.CHUNKS + " collections.");
              throw new KunderaException("Error in saving GridFS file in " + m.getTableName() + MongoDBUtils.FILES
                      + " or " + m.getTableName() + MongoDBUtils.CHUNKS + " collections. Caused By: ", e);
          }
          try
          {
              gfsInputFile.validate();
              log.info("Input GridFS file: " + gfsInputFile.getFilename() + " is validated.");
          }
          catch (MongoException e)
          {
              log.error("Error in validating GridFS file in " + m.getTableName() + MongoDBUtils.FILES + " collection.");
              throw new KunderaException("Error in validating GridFS file in " + m.getTableName() + MongoDBUtils.FILES
                      + " collection. Caused By: ", e);
          }
      }
docs: Save GRID FS file.
  
  @param gfsInputFile
  the gfs input file
  @param m
  the m