List of usage examples for com.google.common.io MoreFiles deleteDirectoryContents
public static void deleteDirectoryContents(Path path, RecursiveDeleteOption... options) throws IOException
From source file:neon.common.files.FileUtils.java
/** * Clears all content from the given folder. * /*from w w w .j a v a2 s. c o m*/ * @param folder */ public static void clearFolder(Path folder) { logger.info("clearing folder " + folder); try { MoreFiles.deleteDirectoryContents(folder, RecursiveDeleteOption.ALLOW_INSECURE); } catch (IOException e) { throw new IllegalArgumentException("can't clear folder " + folder, e); } }