NOTE: URI behaves strange, if it is a JAR Uri, i.e. jar:file://.../some.jar!/, resolve does not work like expected
500536
Location append(String relativeURI) {
        relativeURI = encodeIllegalCharacters(relativeURI);
        if (uri.toString().endsWith("/") && relativeURI.startsWith("/")) {
            relativeURI = relativeURI.substring(1);
        }
        if (!uri.toString().endsWith("/") && !relativeURI.startsWith("/")) {
            relativeURI = "/" + relativeURI;
        }
        return Location.of(URI.create(uri + relativeURI));
    }
567733
URI buildUri(String relativePath)
    {    
        URI uri = null;
        
        try
        {    
            uri = new URI(buildUrl(relativePath));   
        }
        catch (URISyntaxException e)
        {           
            logger.severe("Problem constructing URI: "+e.getClass().getName()+e.getMessage());
        }

        return uri;
    }
929477
public static URI stringAsURI(String s) throws IOException {
    URI u = null;
    // try to make a URI
    try {
      u = new URI(s);
    } catch (URISyntaxException e){
      LOG.error("Syntax error in URI " + s
          + ". Please check hdfs configuration.", e);
    }

    // if URI is null or scheme is undefined, then assume it's file://
    if(u == null || u.getScheme() == null){
      LOG.warn("Path " + s + " should be specified as a URI "
          + "in configuration files. Please update hdfs configuration.");
      u = fileAsURI(new File(s));
    }
    return u;
  }
238118
private URL getResourceFromLocation(String name, String altName, File location) {
		if (location.isDirectory()) {
			try {
				if (altName != null) {
					File f = new File(location, altName);
					if (f.isFile() && f.canRead()) return f.toURI().toURL();
				}
				
				File f = new File(location, name);
				if (f.isFile() && f.canRead()) return f.toURI().toURL();
				return null;
			} catch (MalformedURLException e) {
				return null;
			}
		}
		
		if (!location.isFile() || !location.canRead()) return null;
		
		File absoluteFile; {
			try {
				absoluteFile = location.getCanonicalFile();
			} catch (Exception e) {
				absoluteFile = location.getAbsoluteFile();
			}
		}
		Set<String> jarContents = getOrMakeJarListing(absoluteFile.getAbsolutePath());
		
		String absoluteUri = absoluteFile.toURI().toString();
		
		try {
			if (jarContents.contains(altName)) {
				return new URI("jar:" + absoluteUri + "!/" + altName).toURL();
			}
		} catch (Exception ignore) {
			// intentional fallthrough
		}
		
		try {
			if (jarContents.contains(name)) {
				return new URI("jar:" + absoluteUri + "!/" + name).toURL();
			}
		} catch(Exception ignore) {
			// intentional fallthrough
		}
		
		return null;
	}
267411
private static boolean isOutFile(final URI filePathName, final URI inputMap) {
        final URI relativePath = URLUtils.getRelativePath(inputMap, filePathName);
        return !(relativePath.getPath().length() == 0 || !relativePath.getPath().startsWith(".."));
    }
838666
function resolve() {
    var resolvedPath = '';
    var resolvedAbsolute = false;
    var hasDomain = false;

    for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i -= 1) {
      var p = (i >= 0) ? arguments[i] : !hasDomain ? cwd() : '';

      if (!hasDomain) {
        hasDomain = isDomain(p);
      }

      if (!isString(p)) {
        throw new TypeError('Arguments to path.resolve must be strings');
      } else if (!p) {
        continue;
      }

      resolvedPath = p + '/' + resolvedPath;
      resolvedAbsolute = p[0] === '/';
    }

    resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/');
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  }
859966
function resolve() {
    if (l.search) {
      var q = {};
      l.search.slice(1).split('&').forEach(function(v) {
        var a = v.split('=');
        q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&')
      });
      if (q.p !== undefined) {
        window.history.replaceState(null, null,
          repo + (q.p || '') +
          (q.q ? ('?' + q.q) : '') +
          l.hash
        )
      }
    }
  }
1019720
function resolve(baseUri, relativeUri) {
  // there are several kinds of relative urls:
  // 1. //foo - replaces everything from the domain on.  foo is a domain name
  // 2. foo - replaces the last part of the path, the whole query and fragment
  // 3. /foo - replaces the the path, the query and fragment
  // 4. ?foo - replace the query and fragment
  // 5. #foo - replace the fragment only

  var absoluteUri = baseUri.clone();
  // we satisfy these conditions by looking for the first part of relativeUri
  // that is not blank and applying defaults to the rest

  var overridden = relativeUri.hasScheme();

  if (overridden) {
    absoluteUri.setRawScheme(relativeUri.getRawScheme());
  } else {
    overridden = relativeUri.hasCredentials();
  }

  if (overridden) {
    absoluteUri.setRawCredentials(relativeUri.getRawCredentials());
  } else {
    overridden = relativeUri.hasDomain();
  }

  if (overridden) {
    absoluteUri.setRawDomain(relativeUri.getRawDomain());
  } else {
    overridden = relativeUri.hasPort();
  }

  var rawPath = relativeUri.getRawPath();
  var simplifiedPath = collapse_dots(rawPath);
  if (overridden) {
    absoluteUri.setPort(relativeUri.getPort());
    simplifiedPath = simplifiedPath
        && simplifiedPath.replace(EXTRA_PARENT_PATHS_RE, '');
  } else {
    overridden = !!rawPath;
    if (overridden) {
      // resolve path properly
      if (simplifiedPath.charCodeAt(0) !== 0x2f /* / */) {  // path is relative
        var absRawPath = collapse_dots(absoluteUri.getRawPath() || '')
            .replace(EXTRA_PARENT_PATHS_RE, '');
        var slash = absRawPath.lastIndexOf('/') + 1;
        simplifiedPath = collapse_dots(
            (slash ? absRawPath.substring(0, slash) : '')
            + collapse_dots(rawPath))
            .replace(EXTRA_PARENT_PATHS_RE, '');
      }
    } else {
      simplifiedPath = simplifiedPath
          && simplifiedPath.replace(EXTRA_PARENT_PATHS_RE, '');
      if (simplifiedPath !== rawPath) {
        absoluteUri.setRawPath(simplifiedPath);
      }
    }
  }

  if (overridden) {
    absoluteUri.setRawPath(simplifiedPath);
  } else {
    overridden = relativeUri.hasQuery();
  }

  if (overridden) {
    absoluteUri.setRawQuery(relativeUri.getRawQuery());
  } else {
    overridden = relativeUri.hasFragment();
  }

  if (overridden) {
    absoluteUri.setRawFragment(relativeUri.getRawFragment());
  }

  return absoluteUri;
}
669561
function resolvePath(_path, relativePath = currentWorkDir) {
  if (!isString(_path) || _path.startsWith('~')) {
    return _path;
  }
  const file = nativePath.relative(relativePath, _path);
  return nativePath.join(relativePath, file);
}
21076
private URI decodeHarURI(URI rawURI, Configuration conf) throws IOException {
    String tmpAuth = rawURI.getAuthority();
    //we are using the default file
    //system in the config
    //so create a underlying uri and
    //return it
    if (tmpAuth == null) {
      //create a path
      return FileSystem.getDefaultUri(conf);
    }
    String host = rawURI.getHost();
    String[] str = host.split("-", 2);
    if (str[0] == null) {
      throw new IOException("URI: " + rawURI + " is an invalid Har URI.");
    }
    String underLyingScheme = str[0];
    String underLyingHost = (str.length > 1)? str[1]:null;
    int underLyingPort = rawURI.getPort();
    String auth = (underLyingHost == null && underLyingPort == -1)?
                  null:(underLyingHost+":"+underLyingPort);
    URI tmp = null;
    if (rawURI.getQuery() != null) {
      // query component not allowed
      throw new IOException("query component in Path not supported  " + rawURI);
    }
    try {
      tmp = new URI(underLyingScheme, auth, rawURI.getPath(),
            rawURI.getQuery(), rawURI.getFragment());
    } catch (URISyntaxException e) {
        // do nothing should not happen
    }
    return tmp;
  }
254867
private String resolveUri(String rawUri, EntityContext context, boolean handleURIOverride) throws Siren4JException {
        String resolvedUri = rawUri;
        String baseUri = null;
        boolean fullyQualified = false;
        if (context.getCurrentObject() instanceof Resource) {
            Resource resource = (Resource) context.getCurrentObject();
            baseUri = resource.getBaseUri();
            fullyQualified = resource.isFullyQualifiedLinks() == null ? false : resource.isFullyQualifiedLinks();
            String override = resource.getOverrideUri();
            if (handleURIOverride && StringUtils.isNotBlank(override)) {
                resolvedUri = override;
            }
        }
        resolvedUri = handleTokenReplacement(resolvedUri, context);

        if (fullyQualified && StringUtils.isNotBlank(baseUri)
                && !isAbsoluteUri(resolvedUri)) {
            StringBuffer sb = new StringBuffer();
            sb.append(baseUri.endsWith("/") ? baseUri.substring(0, baseUri.length() - 1) : baseUri);
            sb.append(resolvedUri.startsWith("/") ? resolvedUri : "/" + resolvedUri);
            resolvedUri = sb.toString();
        }
        return resolvedUri;
    }
1210401
@Override
    public File resolveArtifact(String coordinates) throws ArtifactException
    {
        ArtifactRequest request = new ArtifactRequest();
        Artifact artifact = new DefaultArtifact(coordinates);
        request.setArtifact(artifact);
        request.setRepositories(remoteRepositories);

        log.debug(String.format("Resolving artifact %s from %s", artifact, remoteRepositories));

        ArtifactResult result;
        try
        {
            result = repositorySystem.resolveArtifact(repositorySession, request);
        }
        catch (ArtifactResolutionException e)
        {
            throw new ArtifactException(e.getMessage(), e);
        }

        log.debug(String.format("Resolved artifact %s to %s from %s",
                artifact,
                result.getArtifact().getFile(),
                result.getRepository()));

        return result.getArtifact().getFile();
    }
1266808
public static boolean isJarFileURL(URL url) {
        return (URL_PROTOCOL_FILE.equals(url.getProtocol()) &&
                url.getPath().toLowerCase().endsWith(JAR_FILE_EXTENSION));
    }
58934
def resolve_local(self, uri, base_uri, ref):
        
        # read it from the filesystem
        file_path = None
        # make the reference saleskingstyle
        item_name = None
        if (uri.startswith(u"file") or
                uri.startswith(u"File")):
            if ref.startswith(u"./"):
                ref = ref.split(u"./")[-1]
                org_ref = ref
            if ref.find(u"#properties") != -1:
                ref = ref.split(u"#properties")[0]
            if ref.find(u".json") != -1:
                item_name = ref.split(u".json")[0]

        # on windwos systesm this needs to happen
        if base_uri.startswith(u"file://") is True:
            base_uri = base_uri.split(u"file://")[1]
        elif base_uri.startswith(u"File://") is True:
            base_uri = base_uri.split(u"File://")[1]

        file_path = os.path.join(base_uri, ref)
        result = None
        try:
            schema_file = open(file_path, "r").read()
            result = json.loads(schema_file.decode("utf-8"))
        except IOError as e:
            log.error(u"file not found %s" % e)
            msg = "Could not find schema file. %s" % file_path
            raise SalesKingException("SCHEMA_NOT_FOUND", msg)

        if self.cache_remote:
            self.store[uri] = result
        return result
928044
def resolveURI(self, URI):
        
        ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
        return ret
116810
private void findJarFile() throws IOException {
        if (getUseCaches()) {
            synchronized (jarCache) {
                jarFile = jarCache.get(jarFileURL);
            }
            if (jarFile == null) {
                JarFile jar = openJarFile();
                synchronized (jarCache) {
                    jarFile = jarCache.get(jarFileURL);
                    if (jarFile == null) {
                        jarCache.put(jarFileURL, jar);
                        jarFile = jar;
                    } else {
                        jar.close();
                    }
                }
            }
        } else {
            jarFile = openJarFile();
        }

        if (jarFile == null) {
            throw new IOException();
        }
    }
1172108
public static Uri getFileUri(Context context, File file) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            return FileProvider.getUriForFile(context, context.getPackageName() + ".file.path.share", file);
        }
        return Uri.fromFile(file);
    }