Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static boolean removeTagsListCache(File cacheDir) { boolean flag = false; File[] filesList = cacheDir.listFiles(); for (int i = 0; i < filesList.length; i++) { if (filesList[i].isDirectory() && filesList[i].toString().equals("files")) { removeTagsListCache(filesList[i]); } else { filesList[i].delete(); flag = true; } } return flag; } }