Java File List Load getFileList(String path)

Here you can find the source of getFileList(String path)

Description

get File List

License

Apache License

Declaration

public static List<File> getFileList(String path) 

Method Source Code


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

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<File> getFileList(String path) {
        List<File> result = new ArrayList<File>();
        File file = new File(path);
        File[] tempList = file.listFiles();
        for (int i = 0; i < tempList.length; i++) {
            if (tempList[i].isFile()) {
                result.add(tempList[i]);
            }// w w  w.  j a va 2  s. c o  m
            if (tempList[i].isDirectory()) {
            }
        }
        return result;
    }
}

Related

  1. getFileList(String directory, String filterRegexp)
  2. getFileList(String directoryPath)
  3. getFileList(String filePath, FileFilter fileFilter, boolean recursive)
  4. getFileList(String folderPath)
  5. getFileList(String inputFilename)
  6. getFileList(String path)
  7. getFileList(String path)
  8. getFileList(String path)
  9. getFileList(String path)