listFiles() of File not working on symbolic links?
You could read the Symbolic LINK
According to what I've seen while Googling this puzzling behavior, Java requires that you call .getCanonicalFile()
on a File
whose path contains a link before you can use it in other file operations.
So:
File directory = new File("/path/symlink/foo/bar").getCanonicalFile();
String[] files = directory.listFiles();