Here you can find the source of getFilesInFolder(final String pathToFolder, final String suffix)
public static List<String> getFilesInFolder(final String pathToFolder, final String suffix)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> getFilesInFolder(final String pathToFolder, final String suffix) { File folder = new File(pathToFolder); String[] files = folder.list(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toUpperCase().endsWith(suffix.toUpperCase()); }// ww w. ja va 2 s . c o m }); List<String> ret = new ArrayList<String>(); for (String file : files) { ret.add(pathToFolder + File.separator + file); } return ret; } }