Here you can find the source of getFiles(String folderName, String prefix)
static Collection<File> getFiles(String folderName, String prefix)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.ArrayList; import java.util.Collection; public class Main { static Collection<File> getFiles(String folderName, String prefix) { File folder = new File(folderName); File[] files = folder.listFiles(); ArrayList<File> result = new ArrayList<File>(files.length); for (File file : files) { if (file.isFile() && file.getName().startsWith(prefix)) { result.add(file);// www . j a va2s . c o m } } return result; } }