Returns the Base Url of a given URL with
based on its Vendors from the URL
@param url Service URL
@param logger Logger
@return Base URL if service vendor was found otherwise the given URL
9492
public static String getBaseUrl(String url, Logger logger) {
    String answer = url;
    switch (identify(url)) {
      case COMPOSUM:
        answer = url.substring(0, url.indexOf(COMPOSUM_URL));
        break;
      case CRX:
        answer = url.substring(0, url.indexOf(CRX_URL));
        break;
      default:
        logger.error("Given URL is not supported: " + url);
    }
    return answer;
  }
634006
def set_base_url(url):
    
    global _base_url, _dirty

    LOGGER.debug('Setting base URL to %s', url)
    _base_url = url
    _dirty = True
1253123
def base_url(self):
        """"""

        if self.doc.package_url:
            return self.doc.package_url

        return self.doc._ref
142012
public static URL[] findResourceBases(String baseResource, ClassLoader loader)
   {
      ArrayList<URL> list = new ArrayList<URL>();
      try
      {
         Enumeration<URL> urls = loader.getResources(baseResource);
         while (urls.hasMoreElements())
         {
            URL url = urls.nextElement();
            list.add(findResourceBase(url, baseResource));
         }
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
      return list.toArray(new URL[list.size()]);
   }
1307753
def base_url(self) -> str:
        """"""
        return urlunparse(ParseResult(self.scheme, self.host, self.path, '', '', ''))
39182
function fillBaseUrl(url, baseUrl) {
  if (url.indexOf('//') > -1) {
    return url;
  }
  baseUrl = baseUrl || apiConf.baseUrl;

  return `${baseUrl}${url}`;
}
1255960
public static Url getBaseUrl(final Class<? extends Page> pageClass,
		final PageParameters parameters)
	{
		return RequestCycle.get().mapUrlFor(pageClass, parameters);
	}
107843
public static String constructAbsoluteUrl(String theBase, String theEndpoint) {
		if (theEndpoint == null) {
			return null;
		}
		if (isAbsolute(theEndpoint)) {
			return theEndpoint;
		}
		if (theBase == null) {
			return theEndpoint;
		}

		try {
			return new URL(new URL(theBase), theEndpoint).toString();
		} catch (MalformedURLException e) {
			ourLog.warn("Failed to resolve relative URL[" + theEndpoint + "] against absolute base[" + theBase + "]", e);
			return theEndpoint;
		}
	}
137347
public static UrlBuilder parse(String url) {
        final UrlBuilder result = new UrlBuilder();
        result.with(url, UrlTokenizerState.SCHEME_OR_HOST);
        return result;
    }
532933
def _find_base_tds_url(catalog_url):
    
    url_components = urlparse(catalog_url)
    if url_components.path:
        return catalog_url.split(url_components.path)[0]
    else:
        return catalog_url
1041301
public static <T> Parameters.Builder<T> logger(Logger logger) {
        return Parameters.<T> builder().logger(logger);
    }
365177
def getBaseUrl(self):
        ''''''
        components = util.splitpath(os.path.abspath(self.basepath))
        url = '/'.join([url_quote(component, '') for component in components])
        return 'file:///' + url + '/'
225672
def get_url(self, url):
        
        if url.startswith('/'):
            url = '%s%s' % (self.base_url, url)
        return url
249085
public static String buildUrl(String baseUrl, String path) {
        if (path.startsWith("http:") || path.startsWith("https:")) {
            return path;
        }
        if (StringUtils.isEmpty(baseUrl)) {
            return file2url(concatPath(LOCAL_BASE_URL, path));
        } else {
            if (baseUrl.startsWith("http:") || baseUrl.startsWith("https:")) {
                return concatPath(baseUrl, path);
            } else {
                return concatPath(file2url(baseUrl), path);
            }
        }
    }
1039549
@Pure
	@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
	public static URL getParentURL(URL url) throws MalformedURLException {
		if (url == null) {
			return url;
		}
		String path = url.getPath();
		final String prefix;
		final String parentStr;

		switch (URISchemeType.getSchemeType(url)) {
		case JAR:
			final int index = path.indexOf(JAR_URL_FILE_ROOT);
			assert index > 0;
			prefix = path.substring(0, index + 1);
			path = path.substring(index + 1);
			parentStr = URL_PATH_SEPARATOR;
			break;
		case FILE:
			prefix = null;
			parentStr = ".." + URL_PATH_SEPARATOR; //$NON-NLS-1$
			break;
			//$CASES-OMITTED$
		default:
			prefix = null;
			parentStr = URL_PATH_SEPARATOR;
		}

		if (path == null || "".equals(path)) { //$NON-NLS-1$
			path = parentStr;
		}
		int index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR);
		if (index == -1) {
			path = parentStr;
		} else if (index == path.length() - 1) {
			index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR, index - 1);
			if (index == -1) {
				path = parentStr;
			} else {
				path = path.substring(0, index + 1);
			}
		} else {
			path = path.substring(0, index + 1);
		}

		if (prefix != null) {
			path = prefix + path;
		}

		return new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
	}
1340017
public static Properties loadProperties(final URL baseUrl, final String filename) {
        return loadProperties(createUrl(baseUrl, "", filename));
    }
842644
public ParameterParser getUrlParamParser(String url) {
		List<Context> contexts = getContextsForUrl(url);
		if (contexts.size() > 0) {
			return contexts.get(0).getUrlParamParser();
		}
		return this.defaultParamParser;
	}