------------------------------------------------------------ URI methods
966025
private String getEntryEditURI(final String fsid, final boolean relative, final boolean singleEntry) {
        String entryURI = null;
        if (relative) {
            if (singleEntry) {
                entryURI = fsid;
            } else {
                entryURI = singular + "/" + fsid;
            }
        } else {
            entryURI = contextURI + servletPath + "/" + handle + "/" + singular + "/" + fsid;
        }
        return entryURI;
    }
958187
protected URI createUri(String file,
      DatanodeID[] candidates,  UnixUserGroupInformation ugi,
      HttpServletRequest request) throws URISyntaxException {
    String scheme = request.getScheme();
    final DatanodeID host = candidates[0];
    final String hostname;
    if (host instanceof DatanodeInfo) {
      hostname = ((DatanodeInfo)host).getHostName();
    } else {
      hostname = host.getHost();
    }
    
    // Construct query.
    StringBuilder builder = new StringBuilder();
    builder.append("ugi=" + ugi);
    
    // Populate the rest of parameters.
    Enumeration<?> it = request.getParameterNames();
    while (it.hasMoreElements()) {
      String key = it.nextElement().toString();
      String value = request.getParameter(key);
      builder.append("&" + key + "=" + value);
    }

    // Construct the possible candidates for retry
    if (candidates.length > 1) {
      builder.append("&candidates=");
      appendDatanodeID(builder, candidates[1]);
      for (int j=2; j<candidates.length; j++) {
        builder.append(" ");
        appendDatanodeID(builder, candidates[j]);
      }
    }

    // Add namenode address to the url params
    NameNode nn = (NameNode)getServletContext().getAttribute("name.node");
    String addr = NetUtils.toIpPort(nn.getNameNodeAddress());
    builder.append(JspHelper.getUrlParam(JspHelper.NAMENODE_ADDRESS, addr));

    return new URI(scheme, null, hostname,
        "https".equals(scheme)
          ? (Integer)getServletContext().getAttribute("datanode.https.port")
          : host.getInfoPort(),
        "/streamFile" + file, builder.toString(), null);
  }
95163
private static URI createUriFromName(String name) {
        if (name == null) {
            throw new NullPointerException("name");
        }
        try {
            return new URI(name);
        } catch (final URISyntaxException e) {
            throw new IllegalArgumentException("Invalid name: " + name, e);
        }
    }
1146295
@Override
    public Uri insert(Uri uri, ContentValues values) {
        Uri result = null;

        if (!controller.hasPreinitialized()) {
            throw new IllegalStateException("Controller has not been initialized.");
        }

        int patternCode = controller.getUriMatcher().match(uri);
        MatcherPattern pattern = controller.findMatcherPattern(patternCode);
        if (pattern == null) {
            throw new IllegalArgumentException("unknown uri : " + uri.toString());
        }

        Parameter parameter = new Parameter(uri, values);
        SQLiteDatabase db = this.getHelper().getWritableDatabase();

        result = onInsert(this.getHelper(), db, pattern, parameter);
        if (result != null) {
            this.onInsertCompleted(result, uri, pattern, parameter);
        }
        return result;
    }
1167702
private String getURI(HttpServletRequest request)
    {
        String uri= (String)request.getAttribute("javax.servlet.forward.request_uri");
        if (uri == null)
            uri= request.getRequestURI();
        return uri;
    }
79001
function requestURI( $uri )
    {
        $parsed = parse_url( $uri );

        $return = '';
        if ( isset( $parsed['user'] ) )
        {
            $return .= $parsed['user'] . '@' . $parsed['pass'];
        }
        $return .= rtrim( $parsed['path'], '/' ) . '/' . $this->Name;

        if ( isset( $parsed['query'] ) )
        {
            $return  .= '?' . $parsed['query'];
        }
        if ( isset( $parsed['fragment'] ) )
        {
            $return .= '#' . $parsed['fragment'];
        }

        return $return;
    }
406641
public static MatchInfo fromUri(final URI uri, final HttpMethod method) {
        int newPort = uri.getPort();
        if (newPort < 0) {
            try {
                newPort = uri.toURL().getDefaultPort();
            } catch (MalformedURLException | IllegalArgumentException e) {
                newPort = ANY_PORT;
            }
        }

        return new MatchInfo(uri.getScheme(), uri.getHost(), newPort, uri.getPath(), uri.getQuery(),
                             uri.getFragment(), ANY_REALM, method);
    }
561184
def uri(resource, args = {})
      uri = resource.uri(args)

      query_values  = args[:query]   || {}
      header_values = args[:headers] || {}

      params.each { |param|
        name = param.name

        if param.style == 'header'
          value = header_values[name] || header_values[name.to_sym]
          value = param % value

          uri.headers[name] = value if value
        else
          value = query_values[name] || query_values[name.to_sym]
          value = param.format(value, nil, 'query')

          uri.query << value if value && !value.empty?
        end
      }

      uri
    end
745144
private void generateURIForMethod(SQLiteDatabaseSchema schema, List<FieldSpec> listFieldAlias, Set<String> alreadyUsedName, Converter<String, String> format, Pair<String, ContentEntry> entry,
			SQLiteModelMethod method) {
		if (method == null)
			return;
		String alias = "URI_" + entry.value1.pathCostant.substring(0, entry.value1.pathCostant.lastIndexOf("_")).replace("PATH_", "") + "_" + format.convert(method.getName());
		if (!alreadyUsedName.contains(alias)) {
			String contentUri = schema.contentProviderUri().replace("*", "[*]") + "/" + entry.value1.uriTemplate.replace("*", "[*]");
			String contentUriWithParameter = method.contentProviderUri().replace("*", "[*]");

			listFieldAlias.add(FieldSpec.builder(Uri.class, alias, Modifier.STATIC, Modifier.FINAL, Modifier.PUBLIC).addJavadoc("<h2>URI standard</h2>\n<pre>$L</pre></p>\n", contentUri)
					.addJavadoc("<h2>URI with parameters</h2>\n<pre>$L</pre>\n\n", contentUriWithParameter)
					.addJavadoc("<p>Method associated to this URI is {@link $LImpl#$L}</p>\n", method.getParent().getName(), method.contentProviderMethodName)
					.initializer(CodeBlock.of("URI_" + entry.value1.pathCostant)).build());
			alreadyUsedName.add(alias);
		}
	}
88100
function() {
        var args = Array.prototype.slice.call(arguments);
        args.splice(0, 0, this.toString());
        return URI.join.apply(URI, args);
    }
219540
function URI(options) {
  if (!(this instanceof URI))
    return new URI(options);

  this.address = new Address();
  this.amount = -1;
  this.label = null;
  this.message = null;
  this.request = null;

  if (options)
    this.fromOptions(options);
}
321311
private String createUri(String uri) {
        try {
            return FileUtil.URI_SEPARATOR_CHAR
                + FilenameUtils.getPath(uri)
                + URLEncoder.encode(FilenameUtils.getBaseName(uri), StandardCharsets.UTF_8.name())
                + config.getOutputExtension();
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException("Missing UTF-8 encoding??", e); // Won't happen unless JDK is broken.
        }
    }
875983
public Map<String, String> getUrlParams(URI uri) throws URIException {
		Map<String, String> map = new HashMap<>();
		for (NameValuePair parameter : getUrlParamParser(uri.toString()).parseParameters(uri.getEscapedQuery())) {
			String value = parameter.getValue();
			if (value == null) {
				value = "";
			}
			map.put(parameter.getName(), value);
		}
		return map;
	}
181002
private String encodeUri( String uri )
	{
		StringBuilder newUri = new StringBuilder();
		StringTokenizer st = new StringTokenizer( uri, "/ ", true );
		while ( st.hasMoreTokens())
		{
			String tok = st.nextToken();
			if ( tok.equals( "/" )) {
				newUri.append('/');
			} else if ( tok.equals( " " )) {
				newUri.append("%20");
			} else {
				try {
					newUri.append(URLEncoder.encode( tok, "UTF-8" ));
				} catch ( UnsupportedEncodingException uee ) { // NOPMD - imported code
					// imported code
				}
			}
		}
		return newUri.toString();
	}
718358
protected static RequestParams getParams(Uri uri) {
        RequestParams params = new RequestParams();
        Set<String> keys = getQueryParameterNames(uri);
        for (String key : keys) {
            String value = uri.getQueryParameter(key);
            if (TextUtils.isEmpty(value)) {
                value = null;
            }
            params.put(key, value);
        }
        return params;
    }
1267292
@CheckReturnValue
  static URI createUri(String scheme, InetAddress address, int port) throws URISyntaxException {
    checkNotNull(address);
    return new URI(
        scheme,
        null /* userInfo */,
        InetAddresses.toUriString(address),
        port,
        null /* path */,
        null /* query */,
        null /* fragment */);
  }
1229401
public function getUri()
    {
        $uri = parent::getUri();

        if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) {
            $query = parse_url($uri, PHP_URL_QUERY);
            $currentParameters = [];
            if ($query) {
                parse_str($query, $currentParameters);
            }

            $queryString = http_build_query(array_merge($currentParameters, $this->getValues()), '', '&');

            $pos = strpos($uri, '?');
            $base = false === $pos ? $uri : substr($uri, 0, $pos);
            $uri = rtrim($base.'?'.$queryString, '?');
        }

        return $uri;
    }