Count files in folder, ignoring hidden files, ignoring nested folders, in Java
Simply counting files is turning out to be surprisingly difficult in Java.
Is there a way to prevent the “..” folder in Java?
I am making a program which allows the user to control a certain folder and I ran into a security issue which allows the user to read files “../YouShouldNotBeAbleToReadThisFile.txt” and I was wondering if there is a way to block this behavior without manually running filenames through a filter to avoid a slip-up.