Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Files.isHidden instead of File.isHidden
On linux/osx, a file is considered hidden if its name starts with ".". Unfortunately, java.io.File.isHidden checks the file system for a hidden file attribute instead of just checking if the path starts with '.'. This check takes O(10us) per file, which can lead to noticeable latency if there are may files to be checked. The java.nio.file.Files.isHidden method just checks if the path starts with "." on linux/osx and does whatever it needs to do on windows. I don't really understand what the point of the file.getName != "." check is since "." is clearly a hidden file and in most use cases I can think of, you'd want to exclude it where you exclude other files. But since I'm not sure what the point is, I'm leaving it alone. Bonus: annotate type signature of public methods (to quiet intellij)
- Loading branch information