Java Folder Read getFiles(String parent)

Here you can find the source of getFiles(String parent)

Description

get Files

License

Apache License

Declaration

public static List<File> getFiles(String parent) 

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> getFiles(String parent) {
        File parentFile = new File(parent);
        File[] files = parentFile.listFiles();
        List<File> sonFiles = new ArrayList<File>();
        if (parentFile.exists()) {
            for (File temp : files) {
                if (temp.isFile()) {
                    sonFiles.add(temp);/*  w  w w  . ja v  a  2  s  .  c  o m*/
                }
            }
        }
        return sonFiles;
    }
}

Related

  1. getFiles(String dir)
  2. getFiles(String dir)
  3. getFiles(String directoryPath)
  4. getFiles(String dirName, int number)
  5. getFiles(String folderName, String prefix)
  6. getFiles(String path)
  7. getFiles(String path)
  8. getFiles(String path)
  9. getFiles(String path)