public static void deleteFilesByExtension ( File dir , String extension ) { if ( extension == null ) { throw new DataUtilException ( "Filename extension can not be a null value" ) ; } FilenameFilter filter = new FileExtensionFilenameFilter ( extension ) ; FileDeleter . deleteFiles ( dir , filter ) ; }
Delete files in a directory matching a file extension