Examples of parseServerAuthority()


Examples of java.net.URI.parseServerAuthority()

     * With 2396 URI handling, forms such as 'rmi://host:bar'
     * or 'rmi://:<port>' are parsed into a registry based
     * authority. We only want to allow server based naming
     * authorities.
     */
    uri.parseServerAuthority();
      } catch (URISyntaxException use) {
    // Check if the authority is of form ':<port>'
    String authority = uri.getAuthority();
    if (authority != null && authority.startsWith(":")) {
        // Convert the authority to 'localhost:<port>' form
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

        authority = "localhost" + authority;
        try {
      uri = new URI(null, authority, null, null, null);
      // Make sure it now parses to a valid server based
      // naming authority
      uri.parseServerAuthority();
        } catch (URISyntaxException use2) {
      throw new
          MalformedURLException("invalid authority: " + str);
        }
    } else {
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

        URI uri = new URI("http://myhost:-8096/site/index.html");
        assertEquals("TestA, returned wrong port value,", -1, uri.getPort());
        assertNull("TestA, returned wrong host value,", uri.getHost());
        try {
            uri.parseServerAuthority();
            fail("TestA, Expected URISyntaxException");
        } catch (URISyntaxException e) {
            // Expected
        }
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

        uri = new URI("http", "//myhost:-8096", null);
        assertEquals("TestB returned wrong port value,", -1, uri.getPort());
        assertNull("TestB returned wrong host value,", uri.getHost());
        try {
            uri.parseServerAuthority();
            fail("TestB, Expected URISyntaxException");
        } catch (URISyntaxException e) {
            // Expected
        }
    }
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

    "invalid character, '#', in URL: " + url);
  }
  // Make sure that it is a server-based authority, if the authority
  // component exists 
  try {
      uri = uri.parseServerAuthority();
      if (uri.getUserInfo() != null) {
    throw new MalformedURLException(
        "invalid character, '@', in URL host: " + url);
      }
      if ((host = uri.getHost()) == null) {
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

                 * With 2396 URI handling, forms such as 'rmi://host:bar'
                 * or 'rmi://:<port>' are parsed into a registry based
                 * authority. We only want to allow server based naming
                 * authorities.
                 */
                uri.parseServerAuthority();
            } catch (URISyntaxException use) {
                // Check if the authority is of form ':<port>'
                String authority = uri.getAuthority();
                if (authority != null && authority.startsWith(":")) {
                    // Convert the authority to 'localhost:<port>' form
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

                    authority = "localhost" + authority;
                    try {
                        uri = new URI(null, authority, null, null, null);
                        // Make sure it now parses to a valid server based
                        // naming authority
                        uri.parseServerAuthority();
                    } catch (URISyntaxException use2) {
                        throw new
                            MalformedURLException("invalid authority: " + str);
                    }
                } else {
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

        // registry-based.
        URI uri = new URI("http://host:-8096/path/index.html");
        assertEquals("Assert 2: returned wrong port value,", -1, uri.getPort());
        assertNull("Assert 3: returned wrong host value,", uri.getHost());
        try {
            uri.parseServerAuthority();
            fail("Assert 4: Expected URISyntaxException");
        } catch (URISyntaxException e) {
            // Expected
        }
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

        uri = new URI("http", "//myhost:-8096", null);
        assertEquals("Assert 5: returned wrong port value,", -1, uri.getPort());
        assertNull("Assert 6: returned wrong host value,", uri.getHost());
        try {
            uri.parseServerAuthority();
            fail("Assert 7: Expected URISyntaxException");
        } catch (URISyntaxException e) {
            // Expected
        }
    }
View Full Code Here

Examples of java.net.URI.parseServerAuthority()

        URI uri = new URI("http://myhost:-8096/site/index.html");
        assertEquals("TestA, returned wrong port value,", -1, uri.getPort());
        assertNull("TestA, returned wrong host value,", uri.getHost());
        try {
            uri.parseServerAuthority();
            fail("TestA, Expected URISyntaxException");
        } catch (URISyntaxException e) {
            // Expected
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.