Java Folder Read getFiles(String path, final String suffix)

Here you can find the source of getFiles(String path, final String suffix)

Description

get Files

License

Open Source License

Declaration

public static ArrayList<File> getFiles(String path, final String suffix) 

Method Source Code

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

import java.io.*;

import java.util.ArrayList;

public class Main {
    public static ArrayList<File> getFiles(String path, final String suffix) {
        ArrayList<File> flist = new ArrayList<File>();
        File[] files = (new File(path)).listFiles();
        for (File file : files) {
            if (file.isDirectory())
                flist.addAll(getFiles(file.getAbsolutePath(), suffix));
            else if (file.getName().endsWith(suffix))
                flist.add(file);/* w  w w .j  a  v  a 2  s. co  m*/

        }
        return flist;
    }
}

Related

  1. getFiles(String path)
  2. getFiles(String PATH)
  3. getFiles(String path)
  4. getFiles(String path)
  5. getFiles(String path)
  6. getFiles(String path, String endian)
  7. getFiles(String paths)
  8. getFiles(String realpath, List files, String[] fileType)
  9. getFiles(String rootDirectory)