Get the full value of a URI relative to this compilations context
uses current file as the base.
@param uri The relative URI
@return absolute URI
199090
public String resolveRelativeUri(String uri) {
        // sometimes we get uri's massaged from File(String), so check for
        // a root directory separator char
        if (uri.startsWith("/") || uri.startsWith(File.separator)) {
            return uri;
        } else {
            return baseURI + uri;
        }
    }
152811
public static Uri getFileUri(Activity activity, File file) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            return FileProvider.getUriForFile(activity, activity.getPackageName() + ".file.path.share", file);
        }
        return Uri.fromFile(file);
    }
1125211
public Uri getUri() {
        if (uri == null) {
            try {
                uri = uriBuilder.build();
            } catch (Exception e) {
                throw new IllegalStateException("Could not build the URI.", e);
            }
        }
        return uri;
    }
925745
public String getPath(String base, String uri) throws ResourceNotFoundException, IOException {

		String fileName = uri;
		if (!fileName.endsWith(".scss")) {
			fileName += ".scss";
		}

		String parentPath = base.replace('\\', '/');
		fileName = fileName.replace('\\', '/');

		return PathNormalizer.concatWebPath(parentPath, fileName);
	}
4149
@Override
    public URI getURI() throws IOException {
        URL url = getURL();
        try {
            return ResourceUtils.toURI(url);
        } catch (URISyntaxException ex) {
            throw new RuntimeException("Invalid URI [" + url + "]", ex);
        }
    }
54845
public static String getBaseName( String uri )
    {
        int lastSlash = uri.lastIndexOf( '/' );
        assert lastSlash != -1 : uri;
        assert lastSlash < uri.length() - 1 : "URI must not end with a slash: " + uri;
        return uri.substring( lastSlash + 1 );
    }
1070272
@Override
    public URI getBaseUri() {
        String basePath = config.getString(CONFIG_BASE_PATH, "/");
        if (!basePath.endsWith("/")) {
            basePath += "/";
        }
        return URI.create(basePath);
    }
1034540
def _relative(self, uri):
        

        if uri.startswith("http:") or \
           uri.startswith("https:") or \
           uri.startswith("file:") or \
           uri.startswith("/"):
            return uri

        elif exists(uri):
            return relpath(uri, self.basedir)

        else:
            return uri
164804
public static String relativize(String base, String uri)
	{
		URI child = URI.create( raw( uri ) );
		URI parent = URI.create( raw( base ) );
		return parent.relativize( child ).getPath();
	}
1129880
protected static File platformIndependentUriToFile(final URI fileURI) {
        File file;
        try {
            file = new File(fileURI);
        } catch (IllegalArgumentException e) {
            if (fileURI.toString().startsWith("file://")) {
                file = new File(fileURI.toString().substring("file://".length()));
            } else {
                throw e;
            }
        }
        return file;
    }
887573
protected String getBaseUri() {
        if (mSession != null && mSession.getAuthInfo() != null && mSession.getAuthInfo().getBaseDomain() != null){
            return String.format(BoxConstants.BASE_URI_TEMPLATE,mSession.getAuthInfo().getBaseDomain());
        }
        return mBaseUri;
    }
94990
public static boolean isAbsolutePath(String uri) {
        boolean absolute = false;
        if (uri != null) {
            if (uri.indexOf(":/") != -1) {
                absolute = true;
            } else if (uri.indexOf(":\\") != -1) {
                absolute = true;
            }
        }

        return absolute;
    }
475606
public String findString(String uri) throws IOException {
        String fullUri = path + uri;

        URL resource = getResource(fullUri);
        if (resource == null) {
            throw new IOException("Could not find a resource in : " + fullUri);
        }

        return readContents(resource);
    }
869418
private static URI asRefBase( JsonString uri)
    {
    try
      {
      return
        uri == null
        ? null
        : new URI( uri.getChars().toString());
      }
    catch( Exception e)
      {
      throw new ProjectException( String.format( "Error defining reference base=%s", uri), e);
      }
    }
501955
public String getUri() {
        String result = this.uri;

        if (result == null) {
            switch (this.code) {
                case 100:
                    result = BASE_HTTP + "#sec10.1.1";
                    break;
                case 101:
                    result = BASE_HTTP + "#sec10.1.2";
                    break;
                case 102:
                    result = BASE_WEBDAV + "#STATUS_102";
                    break;

                case 200:
                    result = BASE_HTTP + "#sec10.2.1";
                    break;
                case 201:
                    result = BASE_HTTP + "#sec10.2.2";
                    break;
                case 202:
                    result = BASE_HTTP + "#sec10.2.3";
                    break;
                case 203:
                    result = BASE_HTTP + "#sec10.2.4";
                    break;
                case 204:
                    result = BASE_HTTP + "#sec10.2.5";
                    break;
                case 205:
                    result = BASE_HTTP + "#sec10.2.6";
                    break;
                case 206:
                    result = BASE_HTTP + "#sec10.2.7";
                    break;
                case 207:
                    result = BASE_WEBDAV + "#STATUS_207";
                    break;

                case 300:
                    result = BASE_HTTP + "#sec10.3.1";
                    break;
                case 301:
                    result = BASE_HTTP + "#sec10.3.2";
                    break;
                case 302:
                    result = BASE_HTTP + "#sec10.3.3";
                    break;
                case 303:
                    result = BASE_HTTP + "#sec10.3.4";
                    break;
                case 304:
                    result = BASE_HTTP + "#sec10.3.5";
                    break;
                case 305:
                    result = BASE_HTTP + "#sec10.3.6";
                    break;
                case 307:
                    result = BASE_HTTP + "#sec10.3.8";
                    break;

                case 400:
                    result = BASE_HTTP + "#sec10.4.1";
                    break;
                case 401:
                    result = BASE_HTTP + "#sec10.4.2";
                    break;
                case 402:
                    result = BASE_HTTP + "#sec10.4.3";
                    break;
                case 403:
                    result = BASE_HTTP + "#sec10.4.4";
                    break;
                case 404:
                    result = BASE_HTTP + "#sec10.4.5";
                    break;
                case 405:
                    result = BASE_HTTP + "#sec10.4.6";
                    break;
                case 406:
                    result = BASE_HTTP + "#sec10.4.7";
                    break;
                case 407:
                    result = BASE_HTTP + "#sec10.4.8";
                    break;
                case 408:
                    result = BASE_HTTP + "#sec10.4.9";
                    break;
                case 409:
                    result = BASE_HTTP + "#sec10.4.10";
                    break;
                case 410:
                    result = BASE_HTTP + "#sec10.4.11";
                    break;
                case 411:
                    result = BASE_HTTP + "#sec10.4.12";
                    break;
                case 412:
                    result = BASE_HTTP + "#sec10.4.13";
                    break;
                case 413:
                    result = BASE_HTTP + "#sec10.4.14";
                    break;
                case 414:
                    result = BASE_HTTP + "#sec10.4.15";
                    break;
                case 415:
                    result = BASE_HTTP + "#sec10.4.16";
                    break;
                case 416:
                    result = BASE_HTTP + "#sec10.4.17";
                    break;
                case 417:
                    result = BASE_HTTP + "#sec10.4.18";
                    break;
                case 422:
                    result = BASE_WEBDAV + "#STATUS_422";
                    break;
                case 423:
                    result = BASE_WEBDAV + "#STATUS_423";
                    break;
                case 424:
                    result = BASE_WEBDAV + "#STATUS_424";
                    break;

                case 500:
                    result = BASE_HTTP + "#sec10.5.1";
                    break;
                case 501:
                    result = BASE_HTTP + "#sec10.5.2";
                    break;
                case 502:
                    result = BASE_HTTP + "#sec10.5.3";
                    break;
                case 503:
                    result = BASE_HTTP + "#sec10.5.4";
                    break;
                case 504:
                    result = BASE_HTTP + "#sec10.5.5";
                    break;
                case 505:
                    result = BASE_HTTP + "#sec10.5.6";
                    break;
                case 507:
                    result = BASE_WEBDAV + "#STATUS_507";
                    break;

                case 1000:
                    result = BASE_RESTLET
                            + "org/restlet/data/Statuses.html#CONNECTOR_ERROR_CONNECTION";
                    break;
                case 1001:
                    result = BASE_RESTLET
                            + "org/restlet/data/Statuses.html#CONNECTOR_ERROR_COMMUNICATION";
                    break;
                case 1002:
                    result = BASE_RESTLET
                            + "org/restlet/data/Statuses.html#CONNECTOR_ERROR_INTERNAL";
                    break;
            }
        }

        return result;
    }
1242113
function relativeURI(uri, base) {
    
    // reduce base and uri strings to just their difference string
    var baseParts = base.split('/');
    baseParts.pop();
    base = baseParts.join('/') + '/';
    i = 0;
    while (base.substr(i, 1) == uri.substr(i, 1))
      i++;
    while (base.substr(i, 1) != '/')
      i--;
    base = base.substr(i + 1);
    uri = uri.substr(i + 1);

    // each base folder difference is thus a backtrack
    baseParts = base.split('/');
    var uriParts = uri.split('/');
    out = '';
    while (baseParts.shift())
      out += '../';
    
    // finally add uri parts
    while (curPart = uriParts.shift())
      out += curPart + '/';
    
    return out.substr(0, out.length - 1);
  }
287051
public static URI uriParent(URI uri) {
        return uri.getPath().endsWith("/") ? uri.resolve("..") : uri.resolve(".");
    }