Determine if the incoming request is for a static file.

@param  string  $sitePath
@param  string  $siteName
@param  string  $uri
@return string|false
971203
public function isStaticFile($sitePath, $siteName, $uri)
    {
        if (file_exists($staticFilePath = $sitePath.'/public'.rtrim($uri, '/').'/index.html')) {
            return $staticFilePath;
        } elseif (file_exists($staticFilePath = $sitePath.'/public'.rtrim($uri, '/').'/index.php')) {
            return $staticFilePath;
        } elseif (file_exists($staticFilePath = $sitePath.'/public'.$uri)) {
            return $staticFilePath;
        } elseif ($this->isActualFile($staticFilePath = $sitePath.$uri)) {
            return $staticFilePath;
        }

        return false;
    }
1152042
def static(self, uri, file_or_directory, pattern=r'/?.+',
               use_modified_since=True, use_content_range=False):
        '''
        '''
        static_register(self, uri, file_or_directory, pattern,
                        use_modified_since, use_content_range)
424168
public function frontControllerPath($sitePath, $siteName, $uri)
    {
        if ($uri === '/install.php') {
            return $sitePath.'/web/install.php';
        }

        if (0 === strncmp($uri, '/app_dev.php', 12)) {
            $_SERVER['SCRIPT_NAME'] = '/app_dev.php';
            $_SERVER['SCRIPT_FILENAME'] = $sitePath.'/app_dev.php';

            return $sitePath.'/web/app_dev.php';
        }

        return $sitePath.'/web/app.php';
    }
751919
public function isMatch(string $uri): bool {
        list($path) = explode('?', $uri, 2);
        if ($path === '') {
            $path = trim($this->conf['default'], '/');
        }
        /** @noinspection ReturnFalseInspection */
        $lastDotPos = strrpos($path, '.');
        $suffix = '';
        if (false !== $lastDotPos) {
            $suffix = substr($path, $lastDotPos + 1);
            $path = substr($path, 0, $lastDotPos);
        }
        $parts = explode('/', $path);
        $this->args = [];
        while (count($parts)) {
            $p = $parts;
            $lastPart =& $p[count($p) - 1];
            $lastPart = Toolkit::toCamelCase($lastPart, true);
            $className = 'action\\' . implode('\\', $p);
            $classNameAction = $className . 'Action';
            $this->action = null;
            if (class_exists($classNameAction)) {
                $this->action = new $classNameAction();
            } else if (class_exists($className)) {
                $this->action = new $className();
            }

            if ($this->action instanceof Action) {
                $this->action->suffix = $suffix;
                return true;
            } elseif ($this->action !== null) {
                X::logger()->warn('Class ' . get_class($this->action) .
                    " is in the action namespace but not an instance of x2ts\\route\\Action.\n" .
                    "Please check the inheriting chain.");
            }
            array_unshift($this->args, array_pop($parts));
        }

        return false;
    }
1349280
public void highlightPath(String sitePath) {

        openItemsOnPath(sitePath);
        CmsSitemapTreeItem item = getTreeItem(sitePath);
        if (item != null) {
            item.highlightTemporarily(
                1500,
                isLastPage(item.getSitemapEntry()) ? Background.YELLOW : Background.DEFAULT);
        }
    }
1262227
public function serves($sitePath, $siteName, $uri)
    {
        return $this->isModernSculpinProject($sitePath) ||
            $this->isLegacySculpinProject($sitePath);
    }
1142728
public function analyseURI($uri)
    {
        if (($siteaccessPart = "/$this->key") === $uri) {
            return '/';
        }

        if (mb_strpos($uri, $siteaccessPart) === 0) {
            return mb_substr($uri, mb_strlen($siteaccessPart));
        }

        return $uri;
    }
1091769
public void updateSitePath(String sitePath) {

        String newSubTitle = getDisplayedUrl(sitePath);
        removeInvalidChildren();
        getListItemWidget().setSubtitleLabel(newSubTitle);
        String name = getName(sitePath);
        setId(name);
        getListItemWidget().setAdditionalInfoValue(1, name);
        if (getLoadState() == LoadState.LOADED) {
            for (int i = 0; i < getChildCount(); i++) {
                CmsSitemapTreeItem item = (CmsSitemapTreeItem)getChild(i);
                if ((item != null)
                    && (CmsSitemapView.getInstance().getController().getEntryById(item.getEntryId()) != null)) {
                    String path = CmsStringUtil.joinPaths(sitePath, CmsResource.getName(item.getSitePath()));
                    item.updateSitePath(path);
                }
            }
        }
        getListItemWidget().updateTruncation();
    }
330639
protected function isWhitelisted($uri)
    {
        $whiteList = static::$configuration->getWhiteList();

        if (empty($whiteList)) {
            return true;
        }

        $uri = $this->normalizePath($uri);

        foreach ($whiteList as $path) {
            if (strpos($uri, $path) !== false) {
                return true;
            }
        }

        return false;
    }
1006223
@VisibleForTesting
  static URI sourceURI(URI uri) {
    if (!uri.getScheme().equals("jar")) {
      return uri;
    }
    try {
      return URI.create(
          "file:/" + ((JarURLConnection) uri.toURL().openConnection()).getEntryName());
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
1795
public static boolean isWorkplaceUri(URI uri) {

        return (uri != null) && uri.getPath().startsWith(OpenCms.getSystemInfo().getWorkplaceContext());
    }
505098
protected function getFilesStatus(string $filepath) : bool
    {
        $status     = false;
        $path       = explode('/', $filepath);

        if (empty($path[0])) {
            // Internal Path
            $site           = $path[1];
            $acceptables    = ['css', 'CSS'];
            $filename       = $path[count($path) - 1];

            // check if style file has correct extension
            $nameParts = explode('.', $filename);
            if (!in_array($nameParts[count($nameParts) - 1], $acceptables)) {
                return false;
            }

            // Getting the subfolder(s)
            $subfolders     = '';
            for ($i = 2; $i <= count($path) - 2; $i++) {
                $subfolders .= $path[$i] . '/';
            }

            $fullPath = $_SERVER['DOCUMENT_ROOT'] . '/../module/MelisSites/' . $site . '/public/' . $subfolders . $filename;
            if (is_file($fullPath) && file_exists($fullPath)) {
                return true;
            }

        } else {
            // External Path
            if (filter_var($filepath, FILTER_VALIDATE_URL)) {
                $header_response = get_headers($filepath, 1);
                if (strpos($header_response[0], "200") !== false) {
                    // File exists
                    return true;
                }
            }
        }

        return $status;
    }
34732
static String uri(final String... paths) {
        StringBuilder sb = new StringBuilder();
        boolean firstPath = true;
        for (String s : paths) {
            if (s == null || s.isEmpty()) {
                continue;
            }
            if (!s.startsWith("/") && !firstPath) {
                sb.append("/");
            }
            sb.append(stripLeadingSlash(s));
            firstPath = false;
        }
        return sb.toString();
    }
720520
def static(self, uri, file_or_directory, *args, **kwargs):
        
        name = kwargs.pop("name", "static")
        if not name.startswith(self.name + "."):
            name = "{}.{}".format(self.name, name)
        kwargs.update(name=name)

        strict_slashes = kwargs.get("strict_slashes")
        if strict_slashes is None and self.strict_slashes is not None:
            kwargs.update(strict_slashes=self.strict_slashes)

        static = FutureStatic(uri, file_or_directory, args, kwargs)
        self.statics.append(static)
433935
static URL tryToGetValidUrl(String workingDir, String path, String filename) {
        try {
            if (new File(filename).exists())
                return new File(filename).toURI().toURL();
            if (new File(path + File.separator + filename).exists())
                return new File(path + File.separator + filename).toURI().toURL();
            if (new File(workingDir + File.separator + filename).exists())
                return new File(workingDir + File.separator + filename).toURI().toURL();
            if (new File(new URL(filename).getFile()).exists())
                return new File(new URL(filename).getFile()).toURI().toURL();
        } catch (MalformedURLException e) {
            // don't do anything, we're going on the assumption it is a jar, which could be wrong
        }
        return null;
    }
273721
function site_url($uri = '')
	{
		if ($uri == '')
		{
			return $this->slash_item('base_url').$this->item('index_page');
		}

		if ($this->item('enable_query_strings') == FALSE)
		{
			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
			return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix;
		}
		else
		{
			return $this->slash_item('base_url').$this->item('index_page').'?'.$this->_uri_string($uri);
		}
	}
832962
def file_url(path = "sitemap.xml")
      if context
        file_path = File.join("/", context, path)
      else
        file_path = File.join("/", path)
      end

      URI::HTTP.build(:host => host, :path => file_path).to_s
    end