Get the location header as URI. Returns null if there is no location header.
174930
public URI location() {
		String loc = http().getHeaderField("Location");
		if (loc != null) {
			return URI.create(loc);
		}
		return null;
	}
673223
protected String extractLocation(Map<String, List<String>> headers) throws MalformedURLException {
        for (Map.Entry<String, List<String>> head : headers.entrySet()) {
            if ("Location".equalsIgnoreCase(head.getKey())) {
                List<String> locs = head.getValue();
                if (locs != null && locs.size() > 0) {
                    String location = locs.get(0);
                    if (location != null) {
                        return location;
                    } else {
                        return null;
                    }
                }
            }
        }
        return null;
    }
1243025
def get_header(uri):
    
    if uri not in astheaders:
        astheaders[uri] = get_hdu(uri, cutout="[1:1,1:1]")[0].header
    return astheaders[uri]
1221701
public String getCurrentHierPath() throws URIException {
        char[] path = getRawCurrentHierPath();
        return (path == null) ? null : decode(path, getProtocolCharset());
    }
1198054
public String findURIFromDoc(int owner)
  {
    int n = m_sourceTree.size();

    for (int i = 0; i < n; i++)
    {
      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);

      if (owner == sTree.m_root)
        return sTree.m_url;
    }

    return null;
  }
1050699
function(responseObject) {
                var location = this._getLocationHeader(responseObject);
                return location ? location.substr(location.lastIndexOf('/') + 1) : undefined;
            }
280482
@Nullable
    public String getUrl() {
        if (getRepositoryUrl() == null)
            return null;
        return getRepositoryUrl() + "/" + getGroupId().replace('.', '/') + "/" + getArtifactId() + "/" + getVersion() + "/" + getFileNameWithBaseVersion();
    }
731963
def uri(self):
        """"""
        if self.__modified:
            self.__uri = self.__parse_uri()

        return self.__uri
19871
def content_location(self) -> Optional[UnstructuredHeader]:
        """"""
        try:
            return cast(UnstructuredHeader, self[b'content-location'][0])
        except (KeyError, IndexError):
            return None
1063779
public static String getLocation (HttpServletRequest req)
    {
        StringBuffer rurl = req.getRequestURL();
        String qs = req.getQueryString();
        if (qs != null) {
            rurl.append("?").append(qs);
        }
        return rurl.toString();
    }
9549
def get_uri(self, ncname: str) -> Optional[str]:
        
        uri = cu.expand_uri(ncname + ':', self.curi_maps)
        return uri if uri and uri.startswith('http') else None
911160
public String getUri() {

        String uri = m_context.addSiteRoot(m_context.getUri());
        if (m_detailViewId != null) {
            uri += m_detailViewId.toString() + "/";
        }
        return uri;
    }
662817
public static URI getBaseUriForLocation(URI location) {
        // Any request to the public ELBs must be made over https
        boolean useHttps = location.getHost().toLowerCase().endsWith("nexus.bazaarvoice.com");

        return UriBuilder.fromUri(location)
                .scheme(useHttps ? "https" : "http")
                .replacePath(DataStoreClient.SERVICE_PATH)
                .replaceQuery(null)
                .build();
    }
726690
private URL getRedirectURL(String location) throws IOException {
        HttpInputStream in = get(location, false, false);
        try {
            if (in.getStatusCode() == 302) {
                Header h = in.getResponseHeader("location");
                if (h != null) {
                    return new URL(h.getValue());
                }
            }
            return null;
        } finally {
            try {
                in.close();
            } catch (Exception e) {
            }
        }
    }
138226
public static URI getRequestURI(URI requestURI, String hostHeader, IoSession session) {
        boolean secure = SslUtils.isSecure(session);
        String authority = HttpUtils.getHostAndPort(hostHeader, secure);
        // Use getRawPath to get the un-decoded path; getPath returns the post-decode value.
        // This is required to handle special characters like spaces in the URI (KG-831).
        URI uri = URI.create("//" + authority + requestURI.getRawPath());
        return uri;
    }
71888
public static StashLocation getStashLocation(URI location) {
        checkArgument(getLocationType(location) == LocationType.STASH, "Not a stash location");

        String host, path;
        boolean useLatestDirectory;

        Matcher matcher = getLocatorMatcher(location);
        if (matcher.matches()) {
            // Stash is only available for the default group.  Make sure that's the case here
            String group = Objects.firstNonNull(matcher.group("group"), DEFAULT_GROUP);
            checkArgument(DEFAULT_GROUP.equals(group), "Stash not available for group: %s", group);

            // Stash it not available for local
            String universe = matcher.group("universe");
            checkArgument(universe != null, "Stash not available for local");

            Region region = getRegion(Objects.firstNonNull(matcher.group("region"), DEFAULT_REGION));

            host = getS3BucketForRegion(region);
            path = getS3PathForUniverse(universe);
            useLatestDirectory = true;
        } else {
            // The location refers to the actual S3 bucket and path
            host = location.getHost();
            path = location.getPath();
            // Stash paths don't have a leading slash
            if (path != null && path.startsWith("/")) {
                path = path.substring(1);
            }
            useLatestDirectory = false;
        }

        return new StashLocation(host, path, useLatestDirectory);
    }
117604
def _get_request_uri(self, request):
        """"""
        request_uri = request['target']
        if request_uri.startswith('/'):  # eg. GET /index.html
            return (request.get('Host', 'localhost').split(':')[0],
                    request_uri[1:])
        elif '://' in request_uri:  # eg. GET http://rded.nl
            locator = request_uri.split('://', 1)[1]
            host, path = locator.split('/', 1)
            return (host.split(':')[0], path)