Util.java Source code

Java tutorial

Introduction

Here is the source code for Util.java

Source

import java.io.File;

public class Util {

    public static boolean recursiveDeleteFile(File path) {
        if (path.exists()) {
            if (path.isDirectory()) {
                File[] files = path.listFiles();
                for (int i = 0; i < files.length; i++) {
                    if (files[i].isDirectory()) {
                        recursiveDeleteFile(files[i]);
                    } else {
                        files[i].delete();
                    }
                }
            }
        }
        return (path.delete());
    }
}