Java Folder Read getFiles(String path, String endian)

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

Description

get Files

License

Apache License

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.util.ArrayList;

public class Main {
    public static ArrayList<File> getFiles(String path) {
        ArrayList<File> matches = new ArrayList<File>();
        File folder = new File(path);
        File files[] = folder.listFiles();
        for (File f : files)
            matches.add(f);//from   w ww. j  a  va  2s.co m
        return matches;
    }

    public static ArrayList<File> getFiles(String path, String endian) {
        ArrayList<File> matches = new ArrayList<File>();
        File folder = new File(path);
        File files[] = folder.listFiles();
        for (File f : files)
            if (f.getName().endsWith(endian))
                matches.add(f);
        return matches;
    }
}

Related

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