Java Folder Read by Extension getFiles(File dir, final String extensionFilter)

Here you can find the source of getFiles(File dir, final String extensionFilter)

Description

get Files

License

Open Source License

Declaration

public static File[] getFiles(File dir, final String extensionFilter) 

Method Source Code

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

import java.io.File;

import java.io.FilenameFilter;

public class Main {
    public static File[] getFiles(File dir, final String extensionFilter) {
        return dir.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.toLowerCase().endsWith("." + extensionFilter);
            }//from w w w  .  ja  va  2 s.  c om
        });
    }
}

Related

  1. getFiles(File baseDir, String validExtension, List files)
  2. getFiles(File dir, final String extension)
  3. getFiles(File dir, final String extension)
  4. getFiles(File dir, String fileExtension)
  5. getFiles(File folder, String... extensions)
  6. getFiles(final String path, final String ext)
  7. getFiles(String dir, String ext)