I have the following File object pointing to a directory via symbolic link,
File directory = new File(\"/path/symlink/foo/bar\");
String[] files = directory.list
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();