I have a LinkedList of files which I populated using the following line:
File file = new File(directoryPath);
List<File> filesList = new LinkedList<File>(Arrays.asList(file.listFiles()));
This gets me all the files in given directoryPath string.
I then have an Array of the file extensions that are allowed and would like to delete any file (not directory) that's inside which doesn't match up.
String[] file_ext = new String[] {"ext1", "ext2", "ext3"};
How can I proceed to implement this?