I want to create and delete a directory using Java, but it isn\'t working.
File index = new File(\"/home/Work/Indexer1\"); if (!index.exists()) { index.m
Using Apache Commons-IO, it is following one-liner:
import org.apache.commons.io.FileUtils; FileUtils.forceDelete(new File(destination));
This is (slightly) more performant than FileUtils.deleteDirectory.
FileUtils.deleteDirectory