Here you can find the source of getFileList(File f)
Parameter | Description |
---|---|
f | the dir to traverse |
public static List<File> getFileList(File f)
//package com.java2s; //License from project: LGPL import java.io.*; import java.util.ArrayList; import java.util.List; public class Main { /**/*from ww w .java2s . co m*/ * Gets a list of files in the specified dir. Note: Non-recursive, no dirs included * @param f the dir to traverse * @return the list of files */ public static List<File> getFileList(File f) { List<File> fileList = new ArrayList<File>(); File[] files = f.listFiles(); if (files != null) { for (File file : files) { if (!file.isDirectory()) fileList.add(file); } } return fileList; } }