private static boolean isReal(Path localRoot, Path targetRoot) {
      if (localRoot.equals(targetRoot)) {
        return false;
      }

      Path realLocalRoot;

      try {
        realLocalRoot = localRoot.toRealPath(LinkOption.NOFOLLOW_LINKS);
      }
      catch (FileNotFoundException e) {
        return false;
      }
      catch (IOException e) {
        return true;
      }

      try {
        return !realLocalRoot.equals(targetRoot.toRealPath(LinkOption.NOFOLLOW_LINKS));
      }
      catch (IOException e) {
        return true;
      }
    }
private static boolean isReal(Path localRoot, Path targetRoot)