Here you can find the source of getFilesFromDirectory(final File folder)
static List<File> getFilesFromDirectory(final File folder)
//package com.java2s; import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { static List<File> getFilesFromDirectory(final File folder) { List<File> fileList = new ArrayList<>(); File[] list = folder.listFiles(); if (list == null) { return fileList; }/*from w w w . ja v a 2s . co m*/ for (final File fileEntry : list) { if (!fileEntry.isDirectory()) { fileList.add(fileEntry); } } return fileList; } }