agave-common/common-core/src/main/java/org/iplantc/service/common/uri/AgaveUriRegex.java
/**
     * Checks to see if the given URI matches this {@link AgaveUriRegex} value
     * in the context of the current tenant.
     * 
     * @param uri the uri to check
     * @param tenantId the tenant to check against. Defaults to current tenant if null 
     * @return true if the {@code uri} matches any known regex, false otherwise
     */
Checks to see if the given URI matches this  AgaveUriRegex value
in the context of the current tenant.

@param uri the uri to check
@param tenantId the tenant to check against. Defaults to current tenant if null
@return true if the  uri matches any known regex, false otherwise
Checks to see if the given URI matches this AgaveUriRegex value in the context of the current tenant . @param uri the uri to check @param tenantId the tenant to check against . Defaults to current tenant if null @return true if the uri matches any known regex false otherwise
public boolean matches(URI uri, String tenantId) {
        if (uri == null) return false;
        if (StringUtils.isEmpty(tenantId)) {
            tenantId = TenancyHelper.getCurrentTenantId();
        }
        String suri = uri.toString();
        if (this == AGAVE_URI) 
        {
            return suri.matches(this.getRegexStub());
        }
        else if (this == JOBS_URI) 
        {
            String baseUrl = TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_JOB_SERVICE, tenantId);
            return (StringUtils.isNotEmpty(baseUrl) && suri.matches("(?:" + baseUrl.replaceAll("\\:", "\\\\:") + ")" + this.getRegexStub()));
        }
        else if (this == FILES_URI_CUSTOM_SYSTEM) {
            String baseUrl = TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_FILE_SERVICE, tenantId);
            return (StringUtils.isNotEmpty(baseUrl) && suri.matches("(?:" + baseUrl.replaceAll("\\:", "\\\\:") + ")media/system(.*)")
                    && suri.matches(baseUrl + this.getRegexStub()));
        }
        else if (this == FILES_URI_DEFAULT_SYSTEM) {
            String baseUrl = TenancyHelper.resolveURLToCurrentTenant(Settings.IPLANT_FILE_SERVICE, tenantId);
            return (StringUtils.isNotEmpty(baseUrl) && suri.matches("(?:" + baseUrl.replaceAll("\\:", "\\\\:") + ")" + this.getRegexStub()));
        }
        else if (StringUtils.isEmpty(uri.getScheme()) && StringUtils.isEmpty(uri.getHost())) 
        {
            return suri.matches(RELATIVE_PATH.getRegexStub());
        }
        return false;
    }
public boolean matches ( URI uri , String tenantId ) { if ( uri == null ) return false ; if ( StringUtils . isEmpty ( tenantId ) ) { tenantId = TenancyHelper . getCurrentTenantId ( ) ; } String suri = uri . toString ( ) ; if ( this == AGAVE_URI ) { return suri . matches ( this . getRegexStub ( ) ) ; } else if ( this == JOBS_URI ) { String baseUrl = TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_JOB_SERVICE , tenantId ) ; return ( StringUtils . isNotEmpty ( baseUrl ) && suri . matches ( "(?:" + baseUrl . replaceAll ( "\\:" , "\\\\:" ) + ")" + this . getRegexStub ( ) ) ) ; } else if ( this == FILES_URI_CUSTOM_SYSTEM ) { String baseUrl = TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_FILE_SERVICE , tenantId ) ; return ( StringUtils . isNotEmpty ( baseUrl ) && suri . matches ( "(?:" + baseUrl . replaceAll ( "\\:" , "\\\\:" ) + ")media/system(.*)" ) && suri . matches ( baseUrl + this . getRegexStub ( ) ) ) ; } else if ( this == FILES_URI_DEFAULT_SYSTEM ) { String baseUrl = TenancyHelper . resolveURLToCurrentTenant ( Settings . IPLANT_FILE_SERVICE , tenantId ) ; return ( StringUtils . isNotEmpty ( baseUrl ) && suri . matches ( "(?:" + baseUrl . replaceAll ( "\\:" , "\\\\:" ) + ")" + this . getRegexStub ( ) ) ) ; } else if ( StringUtils . isEmpty ( uri . getScheme ( ) ) && StringUtils . isEmpty ( uri . getHost ( ) ) ) { return suri . matches ( RELATIVE_PATH . getRegexStub ( ) ) ; } return false ; }
Checks to see if the given URI matches this {@link AgaveUriRegex} value
 in the context of the current tenant.
Checks to see if the given URI matches this { @link AgaveUriRegex } value in the context of the current tenant .
// nothing to resolve here // resolve job api // resolve files api and check for system info // should be a custom system url. check for valid system pattern // resolve files api against default system  // perhaps it is a file system path