Package org.apache.solr.common.util

## Class URLUtil

- java.lang.Object
- - org.apache.solr.common.util.URLUtil

    public class URLUtil
    extends Object

### Field Summary

Fields
`static Pattern` `URL_PREFIX`

### Constructor Summary

Constructors
`URLUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `buildCoreUrl​(String baseUrl, String coreName)` Create a core URL (e.g.
`static String` `extractBaseUrl​(String coreUrl)`
`static String` `extractCoreFromCoreUrl​(String coreUrl)`
`static String` `getScheme​(String url)`
`static boolean` `hasScheme​(String url)`
`static String` `removeScheme​(String url)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### URL_PREFIX

    public static final Pattern URL_PREFIX

### Constructor Detail

#### URLUtil

    public URLUtil()

### Method Detail

#### removeScheme

    public static String removeScheme​(String url)

#### hasScheme

    public static boolean hasScheme​(String url)

#### getScheme

    public static String getScheme​(String url)

#### extractBaseUrl

    public static String extractBaseUrl​(String coreUrl)

Parameters:
  `coreUrl` - a URL pointing to a specific "core" or collection (i.e. that adheres loosely to the form "scheme://host:port/solr/coreName")
Returns:
  a URL pointing to the Solr node's root path

#### extractCoreFromCoreUrl

    public static String extractCoreFromCoreUrl​(String coreUrl)

#### buildCoreUrl

    public static String buildCoreUrl​(String baseUrl,
                                      String coreName)

Create a core URL (e.g. "http://localhost:8983/solr/myCore") from its individual components

Parameters:
  `baseUrl` - a Solr "base URL" (e.g. "http://localhost:8983/solr/")
  `coreName` - the name of a Solr core or collection (with no leading or trailing slashes)