code: private static boolean isSymbolicLink(final File file, File parentFile) throws PrivilegedActionException {
          File canonicalParentDir = getCanonicalFile(parentFile);
          File fileInCanonicalParentDir = new File(canonicalParentDir, file.getName());
          File canonicalFile = getCanonicalFile(fileInCanonicalParentDir);
  
          return !canonicalFile.equals(fileInCanonicalParentDir.getAbsoluteFile());
      }
docs: Test if a file is a symbolic link. Test only the file.
  A symbolic link elsewhere in the path to the file is not detected.
  
  Gets the canonical form of the parent directory and appends the file name.
  Then compares that canonical form of the file to the "Absolute" file. If
  it doesn't match, then it is a symbolic link.
  
  @param candidateChildFile The file to test as a symbolic link.
  @param candidateParentFile The immediate parent of the target file.
  
  @return True or false telling if the child file is a symbolic link
  from the parent file.
  
  @throws PrivilegedActionException Thrown in case of a failure to
  obtain a canonical file.