Here you can find the source of getAllFilesEndingWith(String path, final String extension)
Parameter | Description |
---|---|
extension | a parameter |
public static File[] getAllFilesEndingWith(String path, final String extension)
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FilenameFilter; public class Main { /**/*from w ww . j ava 2 s . c om*/ * Return an array of {@link File} objects ending with given extension * @param extension * @return */ public static File[] getAllFilesEndingWith(String path, final String extension) { File rootDirectory = new File(path); return rootDirectory.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(extension); } }); } }