Java examples for File Path IO:Symbolic Link
Locating the Target of a Link
import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static void main(String[] args) { Path link = FileSystems.getDefault().getPath("my"); try {/*from w w w . ja v a2s. c o m*/ Path linkedpath = Files.readSymbolicLink(link); System.out.println(linkedpath.toString()); } catch (IOException e) { System.err.println(e); } } }