code: public String getLastPathSegment() {
          if (StringUtils.isBlank(path)) {
              return StringUtils.EMPTY;
          }
          String segment = path;
          segment = StringUtils.substringAfterLast(segment, "/");
          return segment;
      }
docs: Gets the last URL path segment without the query string.
  If there are segment to return,
  an empty string will be returned instead.
  @return the last URL path segment