private static boolean underSymlink(@Nullable VirtualFile file) {
    return file != null && (file.is(VFileProperty.SYMLINK) || underSymlink(file.getParent()));
  }
private static boolean underSymlink(@Nullable VirtualFile file)