tries to resolve a path

@return FALSE when the path cannot be found
515905
public function tryPath($path, $flags = 0x000000) {
    $flags |= self::VALIDATE;
    try {
      return $this->getPath($path, $flags);
    } catch (Exception $e) {
      if ($e->getCode() === self::VALIDATE) {
        return FALSE;
// @codeCoverageIgnoreStart
      } else {
        throw $e;
      }
// @codeCoverageIgnoreEnd
    }
  }
403596
protected function checkPath()
    {
        if ($this->path === null) {
            return true;
        }

        $pathinfo = \UtilsPath();

        if (strpos($pathinfo, $this->path) === 0) {
            $this->currentPrefixPath = $this->path;
            return true;
        } else {
            $re = Regex::parse($this->path);

            if ($re !== false && preg_match('#^' . $re . '#', $pathinfo, $matches)) {
                $this->currentPrefixPath = $matches[0];

                array_shift($matches);

                $this->arguments = array_merge($this->arguments, $matches);

                return true;
            }
        }

        return false;
    }
201683
public boolean hasPath(String path) {
        Props props = pathMap.get(path);
        return props != null && !props.isEmpty();
    }
1073233
private function resolveRemotePath($path)
    {
        if (!isset($this->resolvedRemotePath[$path])) {
            $resolvedPath = $this->volatileFolder->getNewPath();
            if ($this->remoteFilesystem->copy($path, $path, $resolvedPath) !== true) {
                throw new Exception\PathNotFound($path);
            }
            $this->resolvedRemotePath[$path] = $resolvedPath;
        }

        return $this->resolvedRemotePath[$path];
    }
1156201
public boolean isHubPath(String path) throws IOException {
        if ("/".equals(path))
            return true;
        for (String root : getNonHubRoots()) {
            if (root.startsWith("*")) {
                if (path.endsWith(root.substring(1)))
                    return false;
            }
            else if (path.equals(root) || path.startsWith(root + "/")) {
                return false;
            }
        }
        return true;
    }
962977
@Override
	public ResourceResolver getSupportingResolver(String path) {
		LOG.debug("Finding resolver for resource {}...", path);
		for (ResourceResolver resolver : resolvers) {
			if (resolver.supports(path)) {
				LOG.debug("{} can handle resource {}", resolver, path);
				return resolver;
			}
		}

		LOG.debug("No resolver can handle path '{}'", path);
		return null;
	}
1234363
public static File resolve(Class<?> clazz, String path)
    {
        URL url = clazz.getResource(path);
        if (url == null)
        {
            return null;
        }

        File result;
        try
        {
            result = Paths.get(url.toURI()).toFile();
        }
        catch (URISyntaxException ex)
        {
            return null;
        }

        return result;
    }
973124
public String path() {
    if (path == null) {
      if (!hasPath) {
        return path = "";
      }

      int pathEndPos = uri.indexOf('?');
      if (pathEndPos < 0) {
        path = uri;
      } else {
        return path = uri.substring(0, pathEndPos);
      }
    }
    return path;
  }
1349099
@Override
  public boolean exists() {
    try {
      URL url = this.servletContext.getResource(this.path);
      return (url != null);
    } catch (MalformedURLException ex) {
      return false;
    }
  }
116710
protected function ensure_path_exists() {
        global $CFG;
        if (!is_writable($this->path)) {
            if ($this->custompath && !$this->autocreate) {
                throw new coding_exception('File store path does not exist. It must exist and be writable by the web server.');
            }
            $createdcfg = false;
            if (!isset($CFG)) {
                // This can only happen during destruction of objects.
                // A cache is being used within a destructor, php is ending a request and $CFG has
                // already being cleaned up.
                // Rebuild $CFG with directory permissions just to complete this write.
                $CFG = $this->cfg;
                $createdcfg = true;
            }
            if (!make_writable_directory($this->path, false)) {
                throw new coding_exception('File store path does not exist and can not be created.');
            }
            if ($createdcfg) {
                // We re-created it so we'll clean it up.
                unset($CFG);
            }
        }
        return true;
    }
908582
public function resolve($path)
    {
        if ($path[0] !== '@') {
            return DIRECTORY_SEPARATOR === '/' ? $path : strtr($path, '\\', '/');
        }

        if (strpos($path, '{') !== false && preg_match_all('#{([^\}]+)}#', $path, $matches)) {
            foreach ((array)$matches[1] as $k => $match) {
                if (is_numeric($match)) {
                    $replaced = substr(function_exists('random_bytes') ? bin2hex(random_bytes($match / 2 + 1)) : md5(uniqid(mt_rand(), true)), 0, $match);
                } else {
                    /** @noinspection UnSafeIsSetOverArrayInspection */
                    $ts = isset($ts) ? $ts : time();
                    $replaced = date($match, $ts);
                }

                $path = str_replace($matches[0][$k], $replaced, $path);
            }
        }

        if (DIRECTORY_SEPARATOR === '\\') {
            $path = strtr($path, '\\', '/');
        }

        if (($pos = strpos($path, '/')) === false) {
            if (!isset($this->_aliases[$path])) {
                throw new InvalidArgumentException(['`:alias` is not exists', 'alias' => $path]);
            }
            return $this->_aliases[$path];
        }

        $alias = substr($path, 0, $pos);

        if (!isset($this->_aliases[$alias])) {
            throw new InvalidArgumentException(['`:alias` is not exists for `:path`', 'alias' => $alias, 'path' => $path]);
        }

        return $this->_aliases[$alias] . substr($path, $pos);
    }
1352451
def resolve(self, path, strict):
        """"""
        if self.filesystem.is_windows_fs:
            return self._resolve_windows(path, strict)
        return self._resolve_posix(path, strict)
383032
@CheckForNull
    public String getPath() {
        Source parent = getParent();
        if (parent != null)
            return parent.getPath();
        return null;
    }
1350408
public String fixPathInfo(String path)
    {
        if (path == null)
            return null;
        if (path.startsWith("/"))
            path = path.substring(1);   // Resources already start from root/baseURL
        if (baseURL == null)
            if (properties != null)
                if (this.getProperty(BASE_PATH) != null)
                    path = this.getProperty(BASE_PATH) + path;
        return path;
    }
707350
boolean resolvesTo(HttpMethods hm, String p) {
		return(path.equals(p) && hm.equals(meth));
	}
493964
def resolve_path(path):
    """"""
    if path[0] == '~':
        # ~ or ~user
        path = os.path.expanduser(path)
    if path[0] != '/':
        # Relative path
        if cur_dir[-1] == '/':
            path = cur_dir + path
        else:
            path = cur_dir + '/' + path
    comps = path.split('/')
    new_comps = []
    for comp in comps:
        # We strip out xxx/./xxx and xxx//xxx, except that we want to keep the
        # leading / for absolute paths. This also removes the trailing slash
        # that autocompletion adds to a directory.
        if comp == '.' or (comp == '' and len(new_comps) > 0):
            continue
        if comp == '..':
            if len(new_comps) > 1:
                new_comps.pop()
        else:
            new_comps.append(comp)
    if len(new_comps) == 1 and new_comps[0] == '':
        return '/'
    return '/'.join(new_comps)
539284
def path_exist? path
      if path.is_a? Pathname
        return path.exist?
      elsif path.is_a? String
        return Pathname.new(path).exist?
      else
        return false
      end
    end