/**
   * sets currentUsersLinkPath and allUsersLinkPath. If the path is empty, resets userType to a
   * valid userType for this type of link. If no linkPaths are valid, an IllegalArgumentException is
   * thrown.
   *
   * @throws IllegalArgumentException
   * @throws UnsupportedEncodingException
   */
  private void setAllLinkPaths() throws IllegalArgumentException {
    // sets currentUsersLinkPath and allUsersLinkPath
    GetFullLinkPath(CURRENT_USER, linkType);
    GetFullLinkPath(ALL_USERS, linkType);

    // be sure userType is valid. Override initial choice if not.
    if (userType == CURRENT_USER && currentUserLinkPath.length() == 0) {
      userType = ALL_USERS;
    } else if (userType == ALL_USERS && allUsersLinkPath.length() == 0) {
      userType = CURRENT_USER;
    }

    if (allUsersLinkPath.length() == 0 && currentUserLinkPath.length() == 0) {
      throw (new IllegalArgumentException("linkType " + linkType + " is invalid."));
    }
  }