protected boolean cleanDirectory(File directory) {
        if (directory.isDirectory() && directory.listFiles().length != 0) {
            for (File file : directory.listFiles()) {
                if (file.isFile()) {
                    file.delete();
                }
            }
        }
        return directory.delete();
    }
protected boolean cleanDirectory(File directory) {
        if (directory.isDirectory() && directory.listFiles().length != 0) {
            for (File file : directory.listFiles()) {
                if (file.isFile()) {
                    file.delete();
                }
            }
        }
        return directory.delete();
    }
protected boolean cleanDirectory ( File directory ) { if ( directory . isDirectory ( ) && directory . listFiles ( ) . length != 0 ) { for ( File file : directory . listFiles ( ) ) { if ( file . isFile ( ) ) { file . delete ( ) ; } } } return directory . delete ( ) ; }
Delete all file of a directory and then delete this directory

@param directory
@return
Delete all file of a directory and then delete this directory