Java Folder Read getFiles(File folder)

Here you can find the source of getFiles(File folder)

Description

get Files

License

Apache License

Declaration

public static List<File> getFiles(File folder) 

Method Source Code


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

import java.io.File;

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<File> getFiles(File folder) {
        if (!folder.exists())
            folder.mkdirs();//from w  w w. j a v a2  s.  c o m
        List<File> list = new ArrayList<File>();
        for (File fileEntry : folder.listFiles()) {
            if (fileEntry.isDirectory()) {
                getFiles(fileEntry);
            } else {
                list.add(fileEntry);
            }
        }
        return list;
    }
}

Related

  1. getFiles(File directory)
  2. getFiles(File directory)
  3. getFiles(File f, List response)
  4. getFiles(File file)
  5. getFiles(File file, Collection ret)
  6. getFiles(File folder)
  7. getFiles(File folder)
  8. getFiles(File indir)
  9. getFiles(File... repertoires)