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
..extending what @mickthompson suggested, using the NIO File library (> Java 7) you can:
Path link = Paths.get("/path/symlink/foo/bar");
while (Files.isSymbolicLink(link)) {
link = Files.readSymbolicLink(link);
}
Path[] files = Files.list(link).toArray(size -> new Path[size]);
Path is easily converted to File so all your old Java IO code can be safely kept, @see Path#toFile().