Here you can find the source of getFiles(File file)
Parameter | Description |
---|---|
file | the folder |
public static List<File> getFiles(File file)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { /**/*from www.j a v a2 s . c o m*/ * Get all of the files from the direct folder * * @param file * the folder * @return file list */ public static List<File> getFiles(File file) { List<File> fileList = new ArrayList<File>(); if (file.isDirectory()) { for (File child : file.listFiles()) { fileList.addAll(getFiles(child)); } } else { fileList.add(file); } return fileList; } }