I have around 500 text files inside a directory with a same prefix in their filename say dailyReport_.
dailyReport_
The latter part of the file is the date of the fi
Java 8 :
final File downloadDirectory = new File("directoryPath"); final File[] files = downloadDirectory.listFiles( (dir,name) -> name.matches("dailyReport_.*?" )); Arrays.asList(files).stream().forEach(File::delete)