]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils/src/org/simantics/utils/FileUtils.java
Hardening of DB index integrity
[simantics/platform.git] / bundles / org.simantics.utils / src / org / simantics / utils / FileUtils.java
index b3ec46a30c656b2c19fa626785696620b963f1f8..4e68f29c4ac95246da7d81d2b9e14c7b323dafbc 100644 (file)
@@ -1013,4 +1013,10 @@ public class FileUtils {
             return FileVisitResult.CONTINUE;
         }
     }
+    
+    public static void syncFile(File file) throws IOException {
+       try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
+               raf.getFD().sync();
+               }
+    }
 }