Here you can find the source of getAllFilesPresentInFolder(File srcPath)
public static List getAllFilesPresentInFolder(File srcPath)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { public static List getAllFilesPresentInFolder(File srcPath) { List fileList = new ArrayList(); if (srcPath.isDirectory()) { String files[] = srcPath.list(); for (int i = 0; i < files.length; i++) { fileList.addAll(getAllFilesPresentInFolder(new File(srcPath, files[i]))); }/*from ww w. j av a2s . co m*/ } else { fileList.add(srcPath.getAbsolutePath()); } return fileList; } }