Here you can find the source of getFiles(File f, List
private static void getFiles(File f, List<String> response)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.List; public class Main { private static void getFiles(File f, List<String> response) { File files[];/*from w w w .jav a 2 s. c om*/ if (f.isFile()) { response.add(f.getAbsolutePath()); } else { files = f.listFiles(); for (int i = 0; i < files.length; i++) { getFiles(files[i], response); } } } }