Just a one-liner.
import org.apache.commons.io.FileUtils;
FileUtils.deleteDirectory(new File(destination));
Documentation here
More Related Contents:
- Delete directories recursively in Java
- Writing object in text file
- File to byte[] in Java
- BufferedWriter not writing everything to its output file
- How to write a UTF-8 file with Java?
- How to write console output to a txt file
- Reading a .txt file using Scanner class in Java
- File Upload with Java (with progress bar)
- List all files from a directory recursively with Java
- How to add a new line of text to an existing file in Java? [duplicate]
- Java IOException “Too many open files”
- How do I add a resources folder to my Java project in Eclipse
- Getting the inputstream from a classpath resource (XML file)
- How do I use Java to read from a file that is actively being written to?
- Elegant way to read file into byte[] array in Java [duplicate]
- Check line for unprintable characters while reading text file
- Is this the best way to rewrite the content of a file in Java?
- Reset buffer with BufferedReader in Java?
- Java FileInputStream ObjectInputStream reaches end of file EOF
- Is it necessary to close each nested OutputStream and Writer separately?
- I/O concept flush vs sync
- File truncate operation in Java
- Why doesn’t java.io.File have a close method?
- Getting “java.nio.file.AccessDeniedException” when trying to write to a folder
- java IO to copy one File to another
- Does BufferedReader.ready() method ensure that readLine() method does not return NULL?
- Exception in thread “main” java.io.FileNotFoundException: Error
- Java reading a file different methods
- Read an Image/file from External storage Android
- Read large CSV in java