<p>Convert this request into a url compatible with the WSAPI.</p>
The current fetch and any other parameters will be included.

@return the url representing this request.
353762
@Override
    public String toUrl() {

        List<NameValuePair> params = new ArrayList<NameValuePair>(getParams());

        params.add(new BasicNameValuePair("fetch", getFetch().toString()));

        return String.format("%s/%s.js?%s", Ref.getRelativeRef(ref),
                adding ? "add" : "remove",
                URLEncodedUtils.format(params, "utf-8"));
    }
471311
public URL getCharacteristicURL() {
        return new URL(this.protocol, this.adapterAddress, this.deviceAddress, this.deviceAttributes, this.serviceUUID,
                this.characteristicUUID, null);
    }
1050081
public String buildRequestUrl() {
    StringBuilder sb = new StringBuilder();
    sb.append(buildServletPath());
    if (null != pathInfo) {
      sb.append(pathInfo);
    }
    if (null != queryString) {
      sb.append('?').append(queryString);
    }
    return sb.toString();
  }
1139767
private String fetch() throws IOException {
        return this.token
            .method("POST")
            .header(
                "Content-Type",
                "application/x-www-form-urlencoded;charset=UTF-8"
            )
            .header(
                "Authorization",
                String.format(
                    "Basic %s", DatatypeConverter.printBase64Binary(
                        new Utf8String(
                            String.format("%s:%s", this.app, this.key)
                        ).asBytes()
                    )
                )
            )
            .fetch().as(RestResponse.class)
            .assertStatus(HttpURLConnection.HTTP_OK)
            .as(JsonResponse.class)
            .json().readObject().getString(PsTwitter.ACCESS_TOKEN);
    }
69946
protected String getRequestUrl(String key) throws Exception {
        String result = "";
        try {
            result = this.methods.get(key)[0];
        } catch (Exception ex) {
            throw new Exception("Unknown method key: " + key);
        }
        return result;
    }
1141355
public UrlPath urlPath() {
        if (null == urlPath) {
            urlPath = UrlPath.of(null == processedUrl ? req().url() : processedUrl);
        }
        return urlPath;
    }
1238549
public String buildUrl() {
    String onlineUrl = onlineRoute.getCall().request().url().toString();
    String offlineUrl = buildOfflineUrl(onlineUrl);
    return offlineUrl;
  }
271082
public String getRequestURL()
    {
    	HttpServletRequest httpReq = getRequest();
    	if (httpReq==null)
    		return null;
    	else
    		return httpReq.getRequestURL().toString();
    }
986915
@Override
    public String getCompleteURL() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getCompleteURL();
        return null;
    }
562110
public static URL url(final String url) {
        if (url == null) {
            return null;
        }
        try {
            if (url.startsWith("classpath:")) {
                return new URL(null, url, new ClasspathURLStreamHandler());
            }
            return new URL(url);
        } catch (final MalformedURLException ex) {
            throw new IllegalArgumentException("Invalid URL: " + url, ex);
        }
    }
162123
public String getUrl() {
        final String url = basicJdbcConfiguration.getConfiguredUrl();
        if (calculatedUrl == null || StringUtils.hasText(url)) {
            calculatedUrl = url;
            if (!StringUtils.hasText(calculatedUrl) && embeddedDatabaseConnection.isPresent()) {
                calculatedUrl = embeddedDatabaseConnection.get().getUrl(basicJdbcConfiguration.getName());
            }
            if (!StringUtils.hasText(calculatedUrl)) {
                throw new ConfigurationException(String.format("Error configuring data source '%s'. No URL specified", basicJdbcConfiguration.getName()));
            }
        }

        return calculatedUrl;
    }
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);

  }
1023198
@Override
    public String getProxyURL() {
        try {
            if (hasProperty(PROXY_FOR)) {
                return getProperty(PROXY_FOR).getString();
            }
            return null;
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
565098
public String getRedirectUrl() throws XMLStreamException, IOException {
		String url = this.settings.getIdpSsoTargetUrl();
		url += "?SAMLRequest=";

		url += URLEncoder.encode(this.getXmlBase64Request(), "UTF-8");

		if (this.parameters != null) {
			for (Map.Entry<String, String> param : this.parameters.entrySet()) {
				String key = URLEncoder.encode(param.getKey(), "UTF-8");
				String val = URLEncoder.encode(param.getValue(), "UTF-8");
				url += "&" + key + "=" + val;
			}
		}

		return url;
	}
696431
public String getURL()
  {
    int port = getPort();

    return (getScheme() + "://" + getHost() + 
            (port == 80 ? "" : ":" + getPort()) +
            getPath() +
            (_query == null ? "" : "?" + _query));
  }
788056
public static URL getUrl(String url) {
    try {
      return new URL(url);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
767637
public String getAlias()
    {
        String alias = this.properties.get(BaseWebappServlet.ALIAS);
        if (alias == null)
            alias = this.properties.get(BaseWebappServlet.ALIAS.substring(BaseWebappServlet.PROPERTY_PREFIX.length()));
        return HttpServiceTracker.addURLPath(null, alias);
    }