Java Folder Read getFilesForFolder(File folder)

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

Description

get Files For Folder

License

Open Source License

Declaration

public static ArrayList<File> getFilesForFolder(File folder) 

Method Source Code


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

import java.io.File;

import java.util.ArrayList;

public class Main {
    public static ArrayList<File> getFilesForFolder(File folder) {
        ArrayList<File> files = new ArrayList<File>();
        for (File file : folder.listFiles()) {
            if (file.isDirectory()) {
                ArrayList<File> childFolderFiles = new ArrayList<File>();
                childFolderFiles = getFilesForFolder(file);
                files.addAll(childFolderFiles);
            } else {
                files.add(file);//from  ww  w  . j  ava 2 s  .  c om
            }
        }
        return files;
    }
}

Related

  1. getFilesCount(File archiveFile)
  2. getFileset(File projectFolder)
  3. getFilesFolder(String path)
  4. getFilesFor(List patientSets, File inputDirectory)
  5. getFilesForDirectory(File dir)
  6. getFilesForPattern(String pathToScan, String startWith, String endsWith)
  7. getFilesFromClassPath(String classpath)
  8. getFilesFromDiskWorker(File folderToLoad, final String searchPattern, final boolean justFolders)
  9. getFileSimpleName(final File f)