public static List<String> getMatchingFileNames(String root, String filterExpr, boolean fullPath) {
        List<File> fileList = getMatchingFiles(root, filterExpr);
        List<String> list = new ArrayList<String>(fileList.size());

        for (File f : fileList) {
            if (fullPath)
                list.add(f.getAbsolutePath());
            else
                list.add(f.getName());
        }

        return list;
    }
public static List < String > getMatchingFileNames ( String root , String filterExpr , boolean fullPath ) { List < File > fileList = getMatchingFiles ( root , filterExpr ) ; List < String > list = new ArrayList < String > ( fileList . size ( ) ) ; for ( File f : fileList ) { if ( fullPath ) list . add ( f . getAbsolutePath ( ) ) ; else list . add ( f . getName ( ) ) ; } return list ; }
Get a list of file names from the given path that match the provided
filter; not recursive.

@param root
base directory to look for files
@param filterExpr
the regular expression to match, may be null
@return List of File objects; List will be empty if root is null