@@ -707,27 +707,27 @@ public boolean backend_fileExist(String oid, String filepath) {
707707 public void backend_moveFile (String oid , String sourceFile , String destinationFile ) {
708708
709709 // in mongodb gridFS, "move" is performed by updating the "filename" metadata
710-
710+
711711 // first, check that the source file exists
712- if (!backend_fileExist (oid , sourceFile )){
712+ if (!backend_fileExist (oid , sourceFile )) {
713713 throw new RuntimeException ("Source file does not exist: " + sourceFile );
714714 }
715715
716716 // then, ensure that file at destination does not exists
717- if (backend_fileExist (oid , destinationFile )){
717+ if (backend_fileExist (oid , destinationFile )) {
718718 throw new RuntimeException ("Destination file already exists: " + destinationFile );
719719 }
720-
720+
721721 // finally, perform the "move" by updating the filename metadata of the source file to the destination file
722-
722+
723723 String sourceFullPath = oid + "/" + sourceFile ;
724724 String destinationFullPath = oid + "/" + destinationFile ;
725-
725+
726726 Bson query = Filters .eq ("filename" , sourceFullPath );
727727 Bson update = new Document ("$set" , new Document ("filename" , destinationFullPath ));
728-
729- gridFSBucket . getFilesCollection (). updateOne (query , update );
730-
728+
729+ filesCollection . updateOne (query , update , null );
730+
731731 }
732732
733733 @ Override
0 commit comments