Usually there is a need of filtering files into our app and/or show only specific type of files to the users. So, we can limit the appearance of the files with the use of FilenameFilter interface. This could be useful when we have to deal with large file systems or facilitate the user to select a file. In this example ...
Read More »Java FilenameFilter Example
In this example we are going to talk about Java FilenameFilter interface. FilenameFilter is a very convenient interface that helps you filter out specific file names when listing a folder. So, as you might imagine, it is particularly useful for applications that have to navigate through big file systems. Filter file extension In order to use the FilenameFilter class to ...
Read More »Find files with certain extension only using FilenameFilter in Java
In this tutorial we are going to show you how to use the FilenameFilter interface in Java in order to list all the file with a certain property in their names. In this example for instance, we just want to print all the text files in a specific directory, hence the files ending with the “.txt” extension. Instances of classes that implement ...
Read More »Delete files with certain extension only using FilenameFilter in Java
In this tutorial we are going to show you how to use the FilenameFilter interface in Java in order to list all the file with a certain property in their names. In this example for instance, we want to delete all the text files in a specific directory, hence the files ending with “.txt” extension. Instances of classes that implement ...
Read More »