Java Directory to File List getAllFilesIn(File dir, final String type)

Here you can find the source of getAllFilesIn(File dir, final String type)

Description

get All Files In

License

Open Source License

Declaration

public static final List<File> getAllFilesIn(File dir, final String type) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.List;

public class Main {
    public static final List<File> getAllFilesIn(File dir, final String type) {
        return Arrays.asList(dir.listFiles(new FilenameFilter() {
            @Override/*from  w  w w.  ja v  a  2  s.com*/
            public boolean accept(File arg0, String arg1) {
                return arg1.endsWith(type);
            }
        }));
    }
}

Related

  1. getAllFilesEndingWith(String path, final String extension)
  2. getAllFilesForType(File dir, FilenameFilter filter)
  3. getAllFilesFromDir(File dir)
  4. getAllFilesFromFolder(File aFolder, FilenameFilter filenameFilter)
  5. getAllFilesFromFolder(File sampleFolder, ArrayList fileList, FilenameFilter filenameFilter)
  6. getAllFilesInAllSubDirectories(File parentDir, FileFilter filter)
  7. getAllFilesInDir(boolean traverseSubDirs, File dir, boolean includeHidden, String prefix)
  8. getAllFilesInDirectory(File dir)
  9. getAllFilesInDirectory(File directory, List files)