Java Recursive List recursiveListFiles(String path)

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

Description

recursive List Files

License

Open Source License

Parameter

Parameter Description
path a parameter

Declaration

public static List<File> recursiveListFiles(String path) 

Method Source Code

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

import java.io.File;

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

public class Main {
    /**//from  w ww  . ja va  2 s. c om
     * @param path
     * @return
     */
    public static List<File> recursiveListFiles(String path) {

        List<File> result = new ArrayList<File>(Arrays.asList(new File(path).listFiles()));

        for (File f : new File(path).listFiles())
            if (f.isDirectory())
                result.addAll(recursiveListFiles(f.getAbsolutePath()));

        return result;
    }
}

Related

  1. recursiveList(File dir, FilenameFilter filter)
  2. recursiveListFile(File folder)
  3. recursiveListFiles(File baseDir, final FileFilter filter)
  4. recursiveListFiles(File dir, FileFilter filter)
  5. recursiveListFiles(File file, List files)
  6. recursiveListFilesHelper(File dir, FileFilter filter, List fileList)
  7. recursiveListint(List list, File file, FilenameFilter filter)
  8. recursiveListPartialPaths(File parent, boolean includeDirs)