Here you can find the source of getFileList(String path)
public static ArrayList<String> getFileList(String path)
//package com.java2s; import java.io.File; import java.util.ArrayList; public class Main { public static ArrayList<String> getFileList(String path) { ArrayList<String> fileList = new ArrayList<String>(); File dir = new File(path); File[] files = dir.listFiles(); if (files == null) return null; for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { getFileList(files[i].getAbsolutePath()); } else { String fileName = files[i].getAbsolutePath().toLowerCase(); fileList.add(fileName);/* www .j a va 2 s . co m*/ } } return fileList; } }