[Solved] File Lambda expression in Java 7


You would use an Anonymous Inner Class, as Java 8 lambda expressions are essentially syntatical sugar which do nearly the same thing. That would look something like this.

files.addAll(Arrays.asList(folder.listFiles(new FileFilter(){

        @Override
        public boolean accept(File f) {
            return f.getName().endsWith(CustomConstantsRepository.FILE_EXT_DAT) && f.getName().startsWith(fileName)));
        }

})));

solved File Lambda expression in Java 7