Java tutorial
//package com.java2s; import java.io.File; public class Main { public static void deleteNonFolders(File paramFile) { if (paramFile.isDirectory()) { File[] arrayOfFile = paramFile.listFiles(); int i = arrayOfFile.length; for (int j = 0; j < i; j++) deleteNonFolders(arrayOfFile[j]); } } }