Here you can find the source of getAllFiles(String directory)
Parameter | Description |
---|---|
directory | The directory to read. |
public static String[] getAllFiles(String directory)
//package com.java2s; /*=============================================================================== * Copyright (c) 2010-2015 University of Massachusetts. All Rights Reserved. * * Use of the RankLib package is subject to the terms of the software license set * forth in the LICENSE file included with this software, and also available at * http://people.cs.umass.edu/~vdang/ranklib_license.html *=============================================================================== *///from w ww .ja v a 2 s.co m import java.io.*; public class Main { /** * Get all file (non-recursively) from a directory. * @param directory The directory to read. * @return A list of filenames (without path) in the input directory. */ public static String[] getAllFiles(String directory) { File dir = new File(directory); String[] fns = dir.list(); return fns; } }