Validate the ServiceInstance URI.

@param uri
the URI String.
@throws ServiceException
194577
public static void validateURI(String uri) throws ServiceException {
        if (uri == null || uri.isEmpty() || !validateRequiredField(uri, urlRegEx) || !isValidBrace(uri)) {
            throw new ServiceException(ErrorCode.SERVICE_INSTANCE_URI_FORMAT_ERROR);
        }
    }
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);
      }
    }
788748
public static function isValid(string $uri): bool {
        try {
            new self($uri);
        } catch (InvalidUriException $e) {
            return false;
        }

        return true;
    }
549651
private boolean validateAssertion(final HttpServletRequest request, final String serviceTicketId, final Assertion assertion, final Service service) {
        for (val spec : serviceValidateConfigurationContext.getValidationSpecifications()) {
            spec.reset();
            val binder = new ServletRequestDataBinder(spec, "validationSpecification");
            initBinder(request, binder);
            binder.bind(request);
            if (!spec.isSatisfiedBy(assertion, request)) {
                LOGGER.warn("Service ticket [{}] does not satisfy validation specification.", serviceTicketId);
                return false;
            }
        }
        enforceTicketValidationAuthorizationFor(request, service, assertion);
        return true;
    }
789999
@Override
	public HttpClient.RequestSender uri(String uri) {
		return new HttpClientFinalizer(cachedConfiguration.bootstrap(b -> HttpClientConfiguration.uri(b, uri)));
	}
427136
@Override
	public String apply(String serviceId) {
		Matcher matcher = this.servicePattern.matcher(serviceId);
		String route = matcher.replaceFirst(this.routePattern);
		route = cleanRoute(route);
		return (StringUtils.hasText(route) ? route : serviceId);
	}
705579
public void proxyTo(final URI uri) {
		if(uri == null) {
			throw new NullPointerException("URI can't be null");
		}
		if(!JainSipUtils.checkScheme(uri.toString())) {
			// Fix for Issue http://code.google.com/p/mobicents/issues/detail?id=2327, checking the route header
			RouteHeader routeHeader = (RouteHeader) originalRequest.getMessage().getHeader(RouteHeader.NAME);
			if(routeHeader == null || (routeHeader != null && !JainSipUtils.checkScheme(routeHeader.getAddress().getURI().toString()))) {
				throw new IllegalArgumentException("Scheme " + uri.getScheme() + " is not supported");
			}			
		}
		final ProxyBranchImpl branch = new ProxyBranchImpl(uri, this);
		branch.setRecordRoute(recordRoutingEnabled);
		branch.setRecurse(recurse);
		this.proxyBranches.put(uri, branch);
		startProxy();

	}
929543
@Override
    public boolean serviceExists(URI serviceUri) throws ServiceException {
        if (serviceUri == null || !serviceUri.isAbsolute()) {
            log.warn("The Service URI is either absent or relative. Provide an absolute URI");
            return false;
        }

        URI graphUri;
        try {
            graphUri = getGraphUriForElement(serviceUri);
        } catch (URISyntaxException e) {
            log.warn("The namespace of the URI of the message content is incorrect.", e);
            return Boolean.FALSE;
        }

        if (graphUri == null) {
            log.warn("Could not obtain a graph URI for the element. The URI may not be managed by the server - " + serviceUri);
            return Boolean.FALSE;
        }

        String queryStr = new StringBuilder()
                .append("ASK { \n")
                .append("GRAPH <").append(graphUri.toASCIIString()).append("> {")
                .append("<").append(serviceUri.toASCIIString()).append("> <").append(RDF.type.getURI()).append("> <").append(MSM.Service).append("> }\n}").toString();

        Query query = QueryFactory.create(queryStr);
        QueryExecution qe = QueryExecutionFactory.sparqlService(this.graphStoreManager.getSparqlQueryEndpoint().toASCIIString(), query);
        MonitoredQueryExecution qexec = new MonitoredQueryExecution(qe);
        try {
            return qexec.execAsk();
        } finally {
            qexec.close();
        }
    }
334480
private function validateUri(string $uri): void
    {
        if (filter_var($uri, FILTER_VALIDATE_URL) === false) {
            throw new InvalidArgumentException(sprintf('%s is not a valid uri', $uri));
        }
    }
328091
function validate (uri, collection, cb) {
  if ('function' != typeof cb) {
    throw new TypeError('cb must be a function');
  }

  if ('string' != typeof collection) {
    throw new TypeError('collection must be a string');
  }

  if ('string' != typeof uri) {
    throw new TypeError('uri must be a string');
  }
}
226852
@JsonIgnore
  @Override
  public void setUri(URI uri) throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException
  {
    super.setUri(uri);
  }
891526
public static boolean validateResource(URI uri) {
        return uri != null && uri.getPort() != -1 && uri.getHost() != null;
    }
29864
@Override
	public void validate() throws AddressStringException {
		if(isValidated()) {
			return;
		}
		synchronized(this) {
			if(isValidated()) {
				return;
			}
			//we know nothing about this address.  See what it is.
			try {
				parsedAddress = getValidator().validateAddress(this);
				isValid = true;
			} catch(AddressStringException e) {
				cachedException = e;
				isValid = false;
				throw e;
			}
		}
	}
691564
public HttpClient setURI(final String uri) throws HibiscusException {

        try {
            setURI(new URI(uri));
        } catch (URISyntaxException e) {
            throw new HibiscusException(e);
        }

        return this;
    }
972444
public void setImageURI(Uri uri, @Nullable Object callerContext) {
    DraweeController controller =
        mControllerBuilder
            .setCallerContext(callerContext)
            .setUri(uri)
            .setOldController(getController())
            .build();
    setController(controller);
  }
204042
public static function check($uri)
    {
        try {
            $uri = self::factory($uri);
        } catch (Exception $e) {
            return false;
        }

        return $uri->valid();
    }
1045643
public function validateUri(UriInterface $uri)
    {
        $path = trim($uri->getPath(), '/');

        $this->validateDepth($path);

        foreach (explode('/', $path) as $key) {
            $this->validateKeySize($key);
            $this->validateChars($key);
        }
    }