Tag Archives: List files in a directory in Java

A simple way to list/filter files

Here is a very simple and elegant way to list or filter the files in a given directory. For this use the File.listFiles() method of java.io.File class. The example below deletes all the files that end with the “.tmp” extension. … Continue reading

Posted in Java | Tagged , | Leave a comment