Here you can find the source of getFileList(File file)
Parameter | Description |
---|---|
file | File or Folder to scan |
public static File[] getFileList(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from w w w .j ava 2 s .co m * Get complete list of files in folder * @param file File or Folder to scan * @return Array of files */ public static File[] getFileList(File file) { if (file.isFile() && !file.isDirectory()) { return new File[] { file }; } return file.listFiles() != null ? file.listFiles() : new File[0]; } }