Inject the PUB_URI as a real {@link URI}.

@return the PUB_URI
964153
@Provides
    @Named(JanusConfig.PUB_URI)
    public static URI getPubURIAsURI() {
        final String v = getPUBURIAsString();
        try {
            return NetworkUtil.toURI(v);
        } catch (URISyntaxException e) {
            throw new IOError(e);
        }
    }
713142
public SipURI getRecordRouteURI() {
		if(!this.recordRoutingEnabled) throw new IllegalStateException("You must setRecordRoute(true) before getting URI");
		if(recordRouteURI == null && recordRouteURIString != null) {
			try {
				recordRouteURI = new SipURIImpl(((SipURIImpl)sipFactoryImpl.createURI(recordRouteURIString)).getSipURI(), ModifiableRule.ProxyRecordRouteNotModifiable);
				recordRouteURIString = null;
			} catch (ServletParseException e) {
				logger.error("A problem occured while setting the target URI while proxying a request " + recordRouteURIString, e);
				return null;
			}
		}
		return this.recordRouteURI;
	}
1230720
def _url(self, uri):
        """"""
        prefix = "{}://{}{}".format(
            self._protocol,
            self.real_connection.host,
            self._port_postfix(),
        )
        return uri.replace(prefix, '', 1)
662817
public static URI getBaseUriForLocation(URI location) {
        // Any request to the public ELBs must be made over https
        boolean useHttps = location.getHost().toLowerCase().endsWith("nexus.bazaarvoice.com");

        return UriBuilder.fromUri(location)
                .scheme(useHttps ? "https" : "http")
                .replacePath(DataStoreClient.SERVICE_PATH)
                .replaceQuery(null)
                .build();
    }
174930
public URI location() {
		String loc = http().getHeaderField("Location");
		if (loc != null) {
			return URI.create(loc);
		}
		return null;
	}
869418
private static URI asRefBase( JsonString uri)
    {
    try
      {
      return
        uri == null
        ? null
        : new URI( uri.getChars().toString());
      }
    catch( Exception e)
      {
      throw new ProjectException( String.format( "Error defining reference base=%s", uri), e);
      }
    }
116563
public Address createAddress(URI uri) {
		if (logger.isDebugEnabled()) {
			logger.debug("Creating Address fromm URI[" + uri.toString()
					+ "]");
		}
		URIImpl uriImpl = (URIImpl) uri;
		return new AddressImpl(SipFactoryImpl.addressFactory
				.createAddress(uriImpl.getURI()), null, ModifiableRule.Modifiable);
	}
1047707
public URI getURI() {
        final URI locationURI = getClasspathElementURI();
        final String resourcePath = getPathRelativeToClasspathElement();
        final String locationURIStr = locationURI.toString();
        // Check if this is a directory-based module (location URI will end in "/")
        final boolean isDir = locationURIStr.endsWith("/");
        try {
            return new URI((isDir || locationURIStr.startsWith("jar:") ? "" : "jar:") + locationURIStr
                    + (isDir ? "" : "!/") + resourcePath);
        } catch (final URISyntaxException e) {
            throw new IllegalArgumentException("Could not form URL for classpath element: " + locationURIStr
                    + " ; path: " + resourcePath + " : " + e);
        }
    }
1330744
@Provides
	@Singleton
	@Named(GuiceProperties.LOCAL_REST_SERVICES_ENDPOINT)
	public URI getRestServicesEndpoint(@Named(GuiceProperties.STATIC_ENDPOINT_CONFIG_NAME) URI webappUri,
	                                   @Named(GuiceProperties.REST_SERVICES_PREFIX) String restPrefix,
	                                   ServletContext context)
	{
		if (restPrefix.equals(""))
		{
			// resteasy mapped to /
			return webappUri;
		}
		else
		{
			// Strip the leading / from the restpath
			while (restPrefix.startsWith("/"))
				restPrefix = restPrefix.substring(1);

			final String webappPath = webappUri.toString();

			if (webappPath.endsWith("/"))
				return URI.create(webappPath + restPrefix);
			else
				return URI.create(webappPath + "/" + restPrefix);
		}
	}
931973
@Nullable
  public static String getRealPathFromUri(ContentResolver contentResolver, final Uri srcUri) {
    String result = null;
    if (isLocalContentUri(srcUri)) {
      Cursor cursor = null;
      try {
        cursor = contentResolver.query(srcUri, null, null, null, null);
        if (cursor != null && cursor.moveToFirst()) {
          int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
          if (idx != -1) {
            result = cursor.getString(idx);
          }
        }
      } finally {
        if (cursor != null) {
          cursor.close();
        }
      }
    } else if (isLocalFileUri(srcUri)) {
      result = srcUri.getPath();
    }
    return result;
  }
1353806
public HttpClient setURI(final URI uri) {

        final URIBuilder builder = new URIBuilder(uri);

        this.scheme = builder.getScheme();
        this.host   = builder.getHost();
        this.port   = builder.getPort();
        this.path   = builder.getPath();

        this.fragment = builder.getFragment();

        this.resetQueryParameters();

        for (NameValuePair nvp : builder.getQueryParams()) {
            this.queryParameters.add(new BasicNameValuePair(nvp.getName(), nvp.getValue()));
        }

        return this;
    }
284180
public URI forURL(URI uri) {
        QueryStringEncoder encoder = new QueryStringEncoder(uri.toString());
        for (Map.Entry<String, Object> e : params.entrySet()) {
            encoder.addParam(e.getKey(), String.valueOf(e.getValue()));
        }
        try {
            return encoder.toUri();
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Cannot construct a query string from the given params. " +
                    "An invalid parameter was used.");
        }
    }
115511
private String getRealPathFromURI(String contentURI) {
        Uri contentUri = Uri.parse(contentURI);
        Cursor cursor = mContext.getContentResolver().query(contentUri, null, null, null, null);
        if (cursor == null) {
            return contentUri.getPath();
        } else {
            cursor.moveToFirst();
            int index = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
            Log.e(LOG_TAG, String.format("%d", index));

            String str = cursor.getString(index);
            cursor.close();
            return str;
        }


    }
1267292
@CheckReturnValue
  static URI createUri(String scheme, InetAddress address, int port) throws URISyntaxException {
    checkNotNull(address);
    return new URI(
        scheme,
        null /* userInfo */,
        InetAddresses.toUriString(address),
        port,
        null /* path */,
        null /* query */,
        null /* fragment */);
  }
270594
@Override
    public String getURI() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getURI();
        return null;
    }
1023198
@Override
    public String getProxyURL() {
        try {
            if (hasProperty(PROXY_FOR)) {
                return getProperty(PROXY_FOR).getString();
            }
            return null;
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
153358
public List<URI> getURIs() {
        List<URI> uris = new ArrayList<URI>();

        lock.lock();
        try {
            List<URI> result = new ArrayList<URI>(uriIndex.keySet());
            result.remove(null);
            return Collections.unmodifiableList(result);
        } finally {
            uris.addAll(uriIndex.keySet());
            lock.unlock();
        }
    }