Here you can find the source of getFilesStartingWith(String dirName, String startsWith)
public static File[] getFilesStartingWith(String dirName, String startsWith)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { private static String startChars; public static File[] getFilesStartingWith(String dirName, String startsWith) { File dir = new File(dirName); startChars = startsWith;/* w w w. j a v a2 s. co m*/ return dir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String fileName) { return fileName.startsWith(startChars); } }); } }