Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java delete directory

boolean deleteDirectory(File directoryToBeDeleted) {
    File[] allContents = directoryToBeDeleted.listFiles();
    if (allContents != null) {
        for (File file : allContents) {
            deleteDirectory(file);
        }
    }
    return directoryToBeDeleted.delete();
}
Comment

java delete directory with files

import org.apache.commons.io.FileUtils;

FileUtils.deleteDirectory(new File(destination));
Comment

PREVIOUS NEXT
Code Example
Java :: java iterate over list 
Java :: datetimeformatter for java 
Java :: java get last char of string 
Java :: write a name and convert it to an array 
Java :: n queens problem leetcode 
Java :: random java 
Java :: add stringarrays to string list java 
Java :: java const 
Java :: how to convert int into int array of digits in java 
Java :: java how to check string is number 
Java :: string array to string java 
Java :: how to check whether a character is alphabet or not in java 
Java :: java image draw 
Java :: multiplication of two numbers in java using scanner 
Java :: java home mac 
Java :: Do not concatenate text displayed with setText. Use resource string with placeholders. 
Java :: android dismiss keyboard 
Java :: java singleton implementation 
Java :: arrays.tostring java 
Java :: containskey in java 
Java :: jbutton close jframe java 
Java :: counting repeated characters in a string in java 
Java :: android xml hide 
Java :: java create new arraylist with elements 
Java :: Java Converting int to double 
Java :: java producer consumer 
Java :: remove first and last character from string in java 
Java :: timestamp with zone java 
Java :: java arraylist declaration 
Java :: scanner.hasnext() 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =