Here you can find the source of getFiles(File dir, String fileExtension)
Parameter | Description |
---|---|
dir | a parameter |
fileExtension | a parameter |
public static List<File> getFiles(File dir, String fileExtension)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.Arrays; import java.util.List; public class Main { /**//from www. j a va 2 s .co m * Returns all files in the given directory that end on <b>fileExtension</b>. * * @param dir * @param fileExtension * @return */ public static List<File> getFiles(File dir, String fileExtension) { File[] files = dir.listFiles((f, s) -> s.endsWith(fileExtension)); return Arrays.asList(files); } }