Package java.net

Examples of java.net.URISyntaxException


  /** Copied from GstVideoPlayer */
    private static URI parseURI(String uri) {
        try {
            URI u = new URI(uri);
            if (u.getScheme() == null) {
                throw new URISyntaxException(uri, "Invalid URI scheme");
            }
            return u;
        } catch (URISyntaxException e) {
            File f = new File(uri);
            if (!f.exists()) {
View Full Code Here


      if (len > 2 && !"www".equals(hostSegments[0])) //$NON-NLS-1$
        host = hostSegments[len - 2] + "." + hostSegments[len - 1]; //$NON-NLS-1$

      /* Rewrite failed, avoid reloading by throwing an exception */
      else
        throw new URISyntaxException("", "");
    }

    StringBuilder buf = new StringBuilder();
    buf.append("http://"); //$NON-NLS-1$
    buf.append(host);
View Full Code Here

    }
    private static URI parseURI(String uri) {
        try {
            URI u = new URI(uri);
            if (u.getScheme() == null) {
                throw new URISyntaxException(uri, "Invalid URI scheme");
            }
            return u;
        } catch (URISyntaxException e) {
            File f = new File(uri);
            if (!f.exists()) {
View Full Code Here

     */
    protected static URI parseURI(String uri) {
        try {
            URI u = new URI(uri);
            if (u.getScheme() == null) {
                throw new URISyntaxException(uri, "Invalid URI scheme");
            }
            return u;
        } catch (URISyntaxException e) {
            File f = new File(uri);
            if (!f.exists()) {
View Full Code Here

      if (len > 2 && !"www".equals(hostSegments[0])) //$NON-NLS-1$
        host = hostSegments[len - 2] + "." + hostSegments[len - 1]; //$NON-NLS-1$

      /* Rewrite failed, avoid reloading by throwing an exception */
      else
        throw new URISyntaxException("", ""); //$NON-NLS-1$ //$NON-NLS-2$
    }

    StringBuilder buf = new StringBuilder();
    buf.append(HTTP);
    buf.append(host);
View Full Code Here

                defaultEndpointURI = new URI(this.getTarget().getAddress().getValue());
                defaultEndpointURIString = defaultEndpointURI.toString();
                return defaultEndpointURI;
            }
            if (endpointInfo.getAddress() == null) {
                throw new URISyntaxException("<null>",
                                             "Invalid address. Endpoint address cannot be null.",
                                             0);
            }
            defaultEndpointURI = new URI(endpointInfo.getAddress());
            defaultEndpointURIString = defaultEndpointURI.toString();
View Full Code Here

            if (_currentParserState == BindingURLParserState.ERROR)
            {
                _error =
                        "Invalid URL format [current_state = " + prevState + ", details parsed so far " + _bindingURL + " ] error at (" + _index + ") due to " + _error;
                _logger.debug(_error);
                URISyntaxException ex;
                ex = new URISyntaxException(markErrorLocation(),"Error occured while parsing URL",_index);
                throw ex;
            }

            processOptions();
        }
        catch (ArrayIndexOutOfBoundsException e)
        {
                _error = "Invalid URL format [current_state = " + prevState + ", details parsed so far " + _bindingURL + " ] error at (" + _index + ")";
                URISyntaxException ex = new URISyntaxException(markErrorLocation(),"Error occured while parsing URL",_index);
                ex.initCause(e);
                throw ex;
        }
    }
View Full Code Here


        // check if both a binding key and a routing key is specified.
        if (_options.containsKey(BindingURL.OPTION_BINDING_KEY) && _options.containsKey(BindingURL.OPTION_ROUTING_KEY))
        {
            throw new URISyntaxException(String.valueOf(_url),"It is illegal to specify both a routingKey and a bindingKey in the same URL",-1);
        }
    }
View Full Code Here

  public void testDoRequestTokenUnauthorizedOnURISyntaxException() throws Exception {
    when(req.getPathInfo()).thenReturn(REQUEST_TOKEN_PATH);
    when(req.getMethod()).thenReturn("GET");

    doThrow(new URISyntaxException("", "")).when(validator).validateMessage(
        any(OAuthMessage.class), any(OAuthAccessor.class));

    servlet.doGet(req, resp);

    verify(resp).setStatus(HttpServletResponse.SC_UNAUTHORIZED);
View Full Code Here

    when(req.getPathInfo()).thenReturn(ACCESS_TOKEN_PATH);
    when(req.getMethod()).thenReturn("GET");
    Map<String, String[]> params = getDoExchangeTokenParams();
    when(req.getParameterMap()).thenReturn(params);

    doThrow(new URISyntaxException("", "")).when(validator).validateMessage(
        any(OAuthMessage.class), any(OAuthAccessor.class));

    servlet.doGet(req, resp);

    verify(validator).validateMessage(any(OAuthMessage.class), any(OAuthAccessor.class));
View Full Code Here

TOP

Related Classes of java.net.URISyntaxException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.