Java Directory to File List getAllFiles(File outputDir, List files)

Here you can find the source of getAllFiles(File outputDir, List files)

Description

get All Files

License

Open Source License

Declaration

private static void getAllFiles(File outputDir, List<File> files) 

Method Source Code


//package com.java2s;
import java.io.File;
import java.io.FileFilter;

import java.util.List;

public class Main {
    private static void getAllFiles(File outputDir, List<File> files) {
        File[] fileList = outputDir.listFiles(new FileFilter() {

            public boolean accept(File pathname) {
                if (pathname.getName().endsWith(".class") || pathname.isDirectory())
                    return true;
                return false;
            }//w w w. ja va2  s.  c  o m
        });

        for (File file : fileList) {
            if (file.isDirectory()) {
                getAllFiles(file, files);
            } else
                files.add(file);
        }
    }
}

Related

  1. getAllFiles(File directory)
  2. getAllFiles(File directory, boolean hidden)
  3. getAllFiles(File directory, String rootPath)
  4. getAllFiles(File inFileOrDir, boolean recurseDir)
  5. getAllFiles(File input)
  6. getAllFiles(File path, List fileList, boolean recursive)
  7. getAllFiles(File root, FileFilter fileFilter)
  8. getAllFiles(File rootDirectory, FileFilter fileFilter, boolean includeSubdirectories)
  9. getAllFiles(File sourceDirectory, List fileList)