function LocationUrl(url, pathPrefix) {
  pathPrefix = pathPrefix || '';

  /**
   * Parse given html5 (regular) url string into properties
   * @param {string} url HTML5 url
   * @private
   */
  this.$$parse = function(url) {
    var match = matchUrl(url, this);

    if (match.path.indexOf(pathPrefix) !== 0) {
      throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !';
    }

    this.$$path = decodeURIComponent(match.path.substr(pathPrefix.length));
    this.$$search = parseKeyValue(match.search);
    this.$$hash = match.hash && decodeURIComponent(match.hash) || '';

    this.$$compose();
  };

  /**
   * Compose url and update `absUrl` property
   * @private
   */
  this.$$compose = function() {
    var search = toKeyValue(this.$$search),
        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
    this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
                    pathPrefix + this.$$url;
  };

  this.$$parse(url);
}
LocationUrl represents an url
This object is exposed as $location service when HTML5 mode is enabled and supported

@constructor
@param {string} url HTML5 url
@param {string} pathPrefix