X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.utils%2Fsrc%2Forg%2Fsimantics%2Futils%2FFileUtils.java;h=798fd02b8742c302958c495759fc2ef7950c5b0c;hb=411b91db954684861999a5f66280a767055e8258;hp=b3ec46a30c656b2c19fa626785696620b963f1f8;hpb=e146f837494c09725fcb93f708d062a723c6f0fa;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.utils/src/org/simantics/utils/FileUtils.java b/bundles/org.simantics.utils/src/org/simantics/utils/FileUtils.java index b3ec46a30..798fd02b8 100644 --- a/bundles/org.simantics.utils/src/org/simantics/utils/FileUtils.java +++ b/bundles/org.simantics.utils/src/org/simantics/utils/FileUtils.java @@ -840,8 +840,8 @@ public class FileUtils { * @throws IOException */ public static void extractZip(File zipFile, File dst) throws IOException { - if (LOGGER.isDebugEnabled()) - LOGGER.debug("Extracting zip "+zipFile); + if (LOGGER.isTraceEnabled()) + LOGGER.trace("Extracting zip "+zipFile); try (FileInputStream fis = new FileInputStream(zipFile)) { extractZip(fis, dst); } @@ -863,8 +863,8 @@ public class FileUtils { while (entry != null) { // for each entry to be extracted String name = entry.getName(); - if (LOGGER.isDebugEnabled()) - LOGGER.debug("Extracting "+name); + if (LOGGER.isTraceEnabled()) + LOGGER.trace("Extracting "+name); File file = new File(dst, name); if (entry.isDirectory()) @@ -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(); + } + } }