Here you can find the source of resolveForSymbolic(final Path path)
public static Path resolveForSymbolic(final Path path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static Path resolveForSymbolic(final Path path) throws IOException { if (Files.isSymbolicLink(path)) { final Path simLink = Files.readSymbolicLink(path); if (!simLink.isAbsolute()) { // Resolve the path such that the path is relative to the symbolically // linked file's directory final Path symLinkParent = path.toAbsolutePath().getParent(); return symLinkParent.resolve(simLink); }//from w w w. ja v a2 s . co m return simLink; } return path; } }