public CmsSite getSite(String rootPath, String fallbackSiteRoot) {

        CmsSite result = getSiteForRootPath(rootPath);
        if (result == null) {
            result = getSiteForSiteRoot(fallbackSiteRoot);
            if (result == null) {
                result = getDefaultSite();
            }
        }
        return result;
    }
public CmsSite getSite ( String rootPath , String fallbackSiteRoot ) { CmsSite result = getSiteForRootPath ( rootPath ) ; if ( result == null ) { result = getSiteForSiteRoot ( fallbackSiteRoot ) ; if ( result == null ) { result = getDefaultSite ( ) ; } } return result ; }
Returns the site for the given resource path, using the fall back site root
in case the resource path is no root path.<p>

In case neither the given resource path, nor the given fall back site root
matches any configured site, the default site is returned.<p>

Usually the fall back site root should be taken from {@link org.opencms.file.CmsRequestContext#getSiteRoot()},
in which case a site for the site root should always exist.<p>

This is the same as first calling {@link #getSiteForRootPath(String)} with the
<code>resourcePath</code> parameter, and if this fails calling
{@link #getSiteForSiteRoot(String)} with the <code>fallbackSiteRoot</code> parameter,
and if this fails calling {@link #getDefaultSite()}.<p>

@param rootPath the resource root path to get the site for
@param fallbackSiteRoot site root to use in case the resource path is no root path

@return the site for the given resource path, using the fall back site root
in case the resource path is no root path

@see #getSiteForRootPath(String)