* @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);
}
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())
return FileVisitResult.CONTINUE;
}
}
+
+ public static void syncFile(File file) throws IOException {
+ try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) {
+ raf.getFD().sync();
+ }
+ }
}