Resolves links to the known endpoints based on a request with the given
{@code requestUrl}.
@param requestUrl the url of the request for the endpoint links
@return the links
19259
public Map<String, Link> resolveLinks(String requestUrl) {
		String normalizedUrl = normalizeRequestUrl(requestUrl);
		Map<String, Link> links = new LinkedHashMap<>();
		links.put("self", new Link(normalizedUrl));
		for (ExposableEndpoint<?> endpoint : this.endpoints) {
			if (endpoint instanceof ExposableWebEndpoint) {
				collectLinks(links, (ExposableWebEndpoint) endpoint, normalizedUrl);
			}
			else if (endpoint instanceof PathMappedEndpoint) {
				String rootPath = ((PathMappedEndpoint) endpoint).getRootPath();
				Link link = createLink(normalizedUrl, rootPath);
				links.put(endpoint.getEndpointId().toLowerCaseString(), link);
			}
		}
		return links;
	}
993460
@XmlElementWrapper(name = "links")
    @XmlElement(name = "link")
    @JsonProperty(value = "links")
    @ApiModelProperty(value = "The pagination links.", position = 3)
    public List<PageRequestLinkDto> getLinks() {
        return links;
    }
416877
private String getFedoraBaseURL(String requestURL) throws ServletException {
        int i = requestURL.lastIndexOf(_SERVLET_PATH);
        if (i != -1) {
            return requestURL.substring(0, i);
        } else {
            throw new ServletException("Unable to determine Fedora baseURL "
                    + "from request URL.  Request URL does not contain the "
                    + "string '" + _SERVLET_PATH + "', as expected.");
        }
    }
438162
public java.lang.String getRequestUrl() {
    java.lang.Object ref = requestUrl_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      requestUrl_ = s;
      return s;
    }
  }
1035011
public LookupService createLookupService(final String endpointUrl) {
        return new RestAdapter.Builder()
            .setEndpoint(endpointUrl)
            .setErrorHandler(errorHandler)
            .setConverter(new JacksonLookupConverter(jsonFactory))
            .build().create(LookupService.class);
    }
188721
public TokenRequest setTokenServerUrl(GenericUrl tokenServerUrl) {
    this.tokenServerUrl = tokenServerUrl;
    Preconditions.checkArgument(tokenServerUrl.getFragment() == null);
    return this;
  }
580370
public CrawlerResult getUrls(CrawlerConfiguration configuration) {

    final Map<String, String> requestHeaders = configuration.getRequestHeadersMap();
    final HTMLPageResponse resp =
        verifyInput(configuration.getStartUrl(), configuration.getOnlyOnPath(), requestHeaders);

    int level = 0;

    final Set<CrawlerURL> allUrls = new LinkedHashSet<CrawlerURL>();
    final Set<HTMLPageResponse> verifiedUrls = new LinkedHashSet<HTMLPageResponse>();
    final Set<HTMLPageResponse> nonWorkingResponses = new LinkedHashSet<HTMLPageResponse>();

    verifiedUrls.add(resp);

    final String host = resp.getPageUrl().getHost();

    if (configuration.getMaxLevels() > 0) {

      // set the start url
      Set<CrawlerURL> nextToFetch = new LinkedHashSet<CrawlerURL>();
      nextToFetch.add(resp.getPageUrl());

      while (level < configuration.getMaxLevels()) {

        final Map<Future<HTMLPageResponse>, CrawlerURL> futures =
            new HashMap<Future<HTMLPageResponse>, CrawlerURL>(nextToFetch.size());

        for (CrawlerURL testURL : nextToFetch) {
          futures.put(service.submit(new HTMLPageResponseCallable(testURL, responseFetcher, true,
              requestHeaders, false)), testURL);
        }

        nextToFetch =
            fetchNextLevelLinks(futures, allUrls, nonWorkingResponses, verifiedUrls, host,
                configuration.getOnlyOnPath(), configuration.getNotOnPath());
        level++;
      }
    } else {
      allUrls.add(resp.getPageUrl());
    }

    if (configuration.isVerifyUrls())
      verifyUrls(allUrls, verifiedUrls, nonWorkingResponses, requestHeaders);

    LinkedHashSet<CrawlerURL> workingUrls = new LinkedHashSet<CrawlerURL>();
    for (HTMLPageResponse workingResponses : verifiedUrls) {
      workingUrls.add(workingResponses.getPageUrl());
    }
    
    // TODO find a better fix for this
    // wow, this is a hack to fix if the first URL is redirected,
    // then we want to keep that original start url
    if (workingUrls.size() >= 1) {
      List<CrawlerURL> list = new ArrayList<CrawlerURL>(workingUrls);
      list.add(0, new CrawlerURL(configuration.getStartUrl()));
      list.remove(1);
      workingUrls.clear();
      workingUrls.addAll(list);
    }

    return new CrawlerResult(configuration.getStartUrl(), configuration.isVerifyUrls()
        ? workingUrls
        : allUrls, verifiedUrls, nonWorkingResponses);

  }
1126270
public SipServletRequest getLinkedSipServletRequest(SipServletRequest req) {
        if (req == null) {
            throw new NullPointerException("the argument is null");
        }
        return linkedRequestMap.get(req);
    }
155915
public OverlapService createOverlapService(final String endpointUrl) {
        return new RestAdapter.Builder()
            .setEndpoint(endpointUrl)
            .setErrorHandler(errorHandler)
            .setConverter(new JacksonOverlapConverter(jsonFactory))
            .build().create(OverlapService.class);
    }
627371
public RequestBuilder get(final String url) {

    checkNotNull(url, "url may not be null");
    final AsyncHttpClient.BoundRequestBuilder ningRequestBuilder = asyncHttpClient.prepareGet(url);
    return createNewRequestBuilder(url, ningRequestBuilder);
  }
1202810
public Spider startUrls(List<String> startUrls) {
        checkIfRunning();
        this.startRequests = UrlUtils.convertToRequests(startUrls);
        return this;
    }
745790
public Map<String, String> getPathParametersEncoded(String requestUri) {
        
        Matcher m = regex.matcher(requestUri);
        
        return mapParametersFromPath(requestUri, parameters, m);
    }
1282636
private JSONArray getApplicablePathNames (String requestUrl, Integer requestType) throws Exception {
        RequestInformation requestInfo = requestInformation.get();
        List<EndpointOverride> applicablePaths;
        JSONArray pathNames = new JSONArray();
        // Get all paths that match the request
        applicablePaths = PathOverrideService.getInstance().getSelectedPaths(Constants.OVERRIDE_TYPE_REQUEST, requestInfo.client,
                                                                             requestInfo.profile,
                                                                             requestUrl + "?" + requestInfo.originalRequestInfo.getQueryString(),
                                                                             requestType, true);
        // Extract just the path name from each path
        for (EndpointOverride path : applicablePaths) {
            JSONObject pathName = new JSONObject();
            pathName.put("name", path.getPathName());
            pathNames.put(pathName);
        }

        return pathNames;
    }
1295948
public static Optional<MultifactorAuthenticationProvider> resolveProvider(final Map<String, MultifactorAuthenticationProvider> providers,
                                                                              final String requestMfaMethod) {
        return resolveProvider(providers, Stream.of(requestMfaMethod).collect(Collectors.toList()));
    }
165915
public Iterable<DUser> queryByThumbnailUrl(java.lang.String thumbnailUrl) {
    return queryByField(null, DUserMapper.Field.THUMBNAILURL.getFieldName(), thumbnailUrl);
  }
965347
public static String getRequestLink(String url) {

        if (CmsStringUtil.isEmpty(url)) {
            return null;
        }
        int pos = url.indexOf(URL_DELIMITER);
        if (pos >= 0) {
            return url.substring(0, pos);
        }
        return url;

    }
1192715
private String getRequestUrl(String line) {
    int end = line.length() - 2;
    while (line.charAt(end) != ' ') {
      end--;
    }

    int start = end - 1;
    while (line.charAt(start) != ' ') {
      start--;
    }
    return line.substring(start + 1, end);
  }