Java File List Load getFileList(File dirFile, final String filenamePrefix)

Here you can find the source of getFileList(File dirFile, final String filenamePrefix)

Description

get File List

License

Open Source License

Declaration

public static File[] getFileList(File dirFile, final String filenamePrefix) 

Method Source Code


//package com.java2s;

import java.io.File;

import java.io.FilenameFilter;

public class Main {
    public static File[] getFileList(File dirFile, final String filenamePrefix) {

        File[] subFiles = dirFile.listFiles(new FilenameFilter() {
            @Override/*from ww w .j  a v a  2  s. c o m*/
            public boolean accept(File dir, String name) {
                File f = new File(dir + File.separator + name);
                return f.isFile() && name.startsWith(filenamePrefix);
            }
        });
        return subFiles;
    }
}

Related

  1. getFileList(File dir, ArrayList list)
  2. getFileList(File dir, Set arrayList)
  3. getFileList(File dir, String regex)
  4. getFileList(File f)
  5. getFileList(File f, FileFilter filter, boolean recursive, boolean wantDirectory, boolean wantHidden, ArrayList list)
  6. getFileList(File file)
  7. getFileList(File file)