Java tutorial
//package com.java2s; import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> getSubFolderList(String dir) { List<String> results = new ArrayList<String>(); File file = new File(dir); String[] names = file.list(); for (String name : names) { if (new File(dir + "/" + name).isDirectory()) { results.add(name); } } return results; } }