All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mysema.util.FileUtils Maven / Gradle / Ivy

There is a newer version: 3.7.4
Show newest version
package com.mysema.util;

import java.io.File;
import java.io.IOException;

/**
 * FileUtils provides File handling functionality
 * 
 * @author tiwe
 *
 */
public final class FileUtils {

    public static void delete(File file) throws IOException {
        if (file.isDirectory()) {
            for (File f : file.listFiles()) {
                delete(f);
            }
        }
        if (file.isDirectory() || file.isFile()) {
            if (!file.delete()) {
                throw new IllegalStateException("Deletion of " + file.getPath() + " failed");
            }
        }
    }
    
    private FileUtils() {}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy