protected boolean isLegalPath()

in server/src/org/jetbrains/teamcity/widgets/WidgetContentController.java [61:71]


  protected boolean isLegalPath(@NotNull File maybeChild, @NotNull File possibleParent) throws IOException {
    final File parent = possibleParent.getCanonicalFile();
    File child = maybeChild.getCanonicalFile();
    while (child != null) {
      if (child.equals(parent)) {
        return true;
      }
      child = child.getParentFile();
    }
    return false;
  }