Builds a complete LDAP path, ldap and url encoded. Separates only with
",".

@return the LDAP path, for use in an url.
493144
public String toUrl() {
		StringBuffer buffer = new StringBuffer(DEFAULT_BUFFER_SIZE);

		for (int i = names.size() - 1; i >= 0; i--) {
			LdapRdn n = (LdapRdn) names.get(i);
			buffer.append(n.encodeUrl());
			if (i > 0) {
				buffer.append(",");
			}
		}
		return buffer.toString();
	}
1356109
def _get_cache_path_parts(self, link):
        # type: (Link) -> List[str]
        

        # We want to generate an url to use as our cache key, we don't want to
        # just re-use the URL because it might have other items in the fragment
        # and we don't care about those.
        key_parts = [link.url_without_fragment]
        if link.hash_name is not None and link.hash is not None:
            key_parts.append("=".join([link.hash_name, link.hash]))
        key_url = "#".join(key_parts)

        # Encode our key url with sha224, we'll use this because it has similar
        # security properties to sha256, but with a shorter total output (and
        # thus less secure). However the differences don't make a lot of
        # difference for our use case here.
        hashed = hashlib.sha224(key_url.encode()).hexdigest()

        # We want to nest the directories some to prevent having a ton of top
        # level directories where we might run out of sub directories on some
        # FS.
        parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]

        return parts
1031008
public static String buildPath(JsonPath jsonPath) {
        List<String> urlParts = new LinkedList<>();

        JsonPath currentJsonPath = jsonPath;
        String pathPart;
        do {
            if (currentJsonPath instanceof RelationshipsPath) {
                pathPart = RELATIONSHIP_MARK + SEPARATOR + currentJsonPath.getElementName();
            } else if (currentJsonPath instanceof FieldPath) {
                pathPart = currentJsonPath.getElementName();
            } else {
                pathPart = currentJsonPath.getElementName();
                if (currentJsonPath.getIds() != null) {
                    pathPart += SEPARATOR + mergeIds(currentJsonPath.getIds());
                }
            }
            urlParts.add(pathPart);

            currentJsonPath = currentJsonPath.getParentResource();
        } while (currentJsonPath != null);
        Collections.reverse(urlParts);

        return SEPARATOR + StringUtils.join(SEPARATOR, urlParts) + SEPARATOR;
    }
603731
public String getUrl(){
		final StringBuilder sb = new StringBuilder();
		sb.append("http://");
		sb.append(getHttpConfiguration().getBindHost().get());
		sb.append(":");
		sb.append(getHttpConfiguration().getPort());
		
		return sb.toString();
	}
1100704
public static String buildPath(String first, String... parts) {
        StringBuilder result = new StringBuilder(first);

        for (String part : parts) {
            if (result.length() == 0) {
                if (part.startsWith("/")) {
                    result.append(part.substring(1));
                } else {
                    result.append(part);
                }
            } else {
                if (result.toString().endsWith("/") && part.startsWith("/")) {
                    result.append(part.substring(1));
                } else if (!result.toString().endsWith("/") && !part.startsWith("/") && !part.isEmpty()) {
                    result.append("/").append(part);
                } else {
                    result.append(part);
                }
            }
        }

        return result.toString();
    }
915445
public String getPath() {
        if (path == null) {
            // create a URI to automatically decode the path
            URI uri = URI.create(httpServletRequest.getRequestURL().toString());
            String requestUri = uri.getPath();

            path = applicationPath.isEmpty() ? requestUri : requestUri.substring(applicationPath.length());
            if (StringUtils.isNullOrEmpty(path)) {
                path = "/";
            }
        }

        return path;
    }
1035116
public @NotNull String build() {
    SortedMap<String, Object> sortedParameterMap = new TreeMap<>(parameterMap);

    // gather resource paths in a treeset (having them in a defined order helps with caching)
    SortedSet<String> resourcePathsSet = new TreeSet<>();

    // iterate over all parts that should be kept from the current request
    for (String nextPart : initialSuffixParts) {
      // if this is a key-value-part:
      if (nextPart.indexOf(KEY_VALUE_DELIMITER) > 0) {
        String key = decodeKey(nextPart);
        // decode and keep the part if it is not overridden in the given parameter-map
        if (!sortedParameterMap.containsKey(key)) {
          String value = decodeValue(nextPart);
          sortedParameterMap.put(key, value);
        }
      }
      else {
        // decode and keep the resource paths (unless they are specified again in resourcePaths)
        String path = decodeResourcePathPart(nextPart);
        if (!resourcePaths.contains(path)) {
          resourcePathsSet.add(path);
        }
      }
    }

    // copy the resources specified as parameters to the sorted set of paths
    if (resourcePaths != null) {
      resourcePathsSet.addAll(ImmutableList.copyOf(resourcePaths));
    }

    // gather all suffix parts in this list
    List<String> suffixParts = new ArrayList<>();

    // now encode all resource paths
    for (String path : resourcePathsSet) {
      suffixParts.add(encodeResourcePathPart(path));
    }

    // now encode all entries from the parameter map
    for (Entry<String, Object> entry : sortedParameterMap.entrySet()) {
      Object value = entry.getValue();
      if (value == null) {
        // don't add suffix part if value is null
        continue;
      }
      String encodedKey = encodeKeyValuePart(entry.getKey());
      String encodedValue = encodeKeyValuePart(value.toString());
      suffixParts.add(encodedKey + KEY_VALUE_DELIMITER + encodedValue);
    }

    // finally join these parts to a single string
    return StringUtils.join(suffixParts, SUFFIX_PART_DELIMITER);
  }
472592
public String getLdapEncoded() {
		if (components.size() == 0) {
			throw new IndexOutOfBoundsException("No components in Rdn.");
		}
		StringBuffer sb = new StringBuffer(DEFAULT_BUFFER_SIZE);
		for (Iterator iter = components.values().iterator(); iter.hasNext();) {
			LdapRdnComponent component = (LdapRdnComponent) iter.next();
			sb.append(component.encodeLdap());
			if (iter.hasNext()) {
				sb.append("+");
			}
		}

		return sb.toString();
	}
1087215
public static String encodePath(String path) {
        if (path == null || path.length() == 0)
            return path;

        StringBuilder buf = encodePath(null, path, 0);
        return buf == null ? path : buf.toString();
    }
1211633
private File getJarPath() {
        String decodedPath = ".";
        String jarPath = "";
        final ProtectionDomain domain = Settings.class.getProtectionDomain();
        if (domain != null && domain.getCodeSource() != null && domain.getCodeSource().getLocation() != null) {
            jarPath = Settings.class.getProtectionDomain().getCodeSource().getLocation().getPath();
        }
        try {
            decodedPath = URLDecoder.decode(jarPath, StandardCharsets.UTF_8.name());
        } catch (UnsupportedEncodingException ex) {
            LOGGER.trace("", ex);
        }

        final File path = new File(decodedPath);
        if (path.getName().toLowerCase().endsWith(".jar")) {
            return path.getParentFile();
        } else {
            return new File(".");
        }
    }
483794
public static function path()
    {
        $url = '';

        // Get the rest of the URL
        if (!Arr::key('REQUEST_URI', $_SERVER)) {
            // Microsoft IIS doesn't set REQUEST_URI by default
            if ($queryString = Arr::key('QUERY_STRING', $_SERVER, true)) {
                $url .= '?' . $queryString;
            }
        } else {
            $url .= $_SERVER['REQUEST_URI'];
        }

        return $url ?: null;
    }
196320
private String buildServletPath() {
    String uri = servletPath;
    if (uri == null && null != requestURI) {
      uri = requestURI;
      if (!contextPath.equals("/")) uri = uri.substring(contextPath.length());
    }
    return (null == uri) ? "" : uri;
  }
252822
public static String encodeUrl(String path) {
        if (path != null) {
            path = path.replaceAll(">", "%3E");
            path = path.replaceAll("<", "%3C");
            path = path.replaceAll(" ", "%20");
        }
        return path;
    }
182699
public String getUrlParams()
   {
      StringBuffer osParams = new StringBuffer();

      for (Iterator i = this.entrySet().iterator(); i.hasNext();)
      {
         Map.Entry entry = (Map.Entry)i.next();
         if (entry.getValue() != null)
            osParams.append("&" + encodeConfig(entry.getKey().toString()) + "="
               + encodeConfig(entry.getValue().toString()));
      }
      return osParams.toString();
   }
249085
public static String buildUrl(String baseUrl, String path) {
        if (path.startsWith("http:") || path.startsWith("https:")) {
            return path;
        }
        if (StringUtils.isEmpty(baseUrl)) {
            return file2url(concatPath(LOCAL_BASE_URL, path));
        } else {
            if (baseUrl.startsWith("http:") || baseUrl.startsWith("https:")) {
                return concatPath(baseUrl, path);
            } else {
                return concatPath(file2url(baseUrl), path);
            }
        }
    }
1323608
String getPath() {
    StringBuilder result = new StringBuilder();

    boolean first = true;
    for (String part : getSegments()) {
      if (first) {
        result.append(part);
        first = false;
      } else {
        result.append("/").append(part);
      }
    }

    return result.toString();
  }
1372969
public String getFullPath()
  {
    if (_root == this || _root == null)
      return getPath();

    String rootPath = _root.getFullPath();
    String path = getPath();

    if (rootPath.length() <= 1)
      return path;
    else if (path.length() <= 1)
      return rootPath;
    else
      return rootPath + path;
  }