Here you can find the source of getFileList(String path)
public static List<File> getFileList(String path)
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.ArrayList; import java.util.List; public class Main { public static List<File> getFileList(String path) { List<File> result = new ArrayList<File>(); File file = new File(path); File[] tempList = file.listFiles(); for (int i = 0; i < tempList.length; i++) { if (tempList[i].isFile()) { result.add(tempList[i]); }// w w w. j a va 2 s. c o m if (tempList[i].isDirectory()) { } } return result; } }