Java Code Examples for sun.net.util.IPAddressUtil#checkAuthority()

The following examples show how to use sun.net.util.IPAddressUtil#checkAuthority() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpsURLConnectionImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 2
Source File: HttpURLConnection.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 3
Source File: HttpsURLConnectionImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 4
Source File: HttpURLConnection.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 5
Source File: HttpsURLConnectionImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 6
Source File: HttpURLConnection.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 7
Source File: HttpsURLConnectionImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 8
Source File: HttpURLConnection.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 9
Source File: HttpsURLConnectionImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 10
Source File: HttpURLConnection.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static URL checkURL(URL u) throws IOException {
    if (u != null) {
        if (u.toExternalForm().indexOf('\n') > -1) {
            throw new MalformedURLException("Illegal character in URL");
        }
    }
    String s = IPAddressUtil.checkAuthority(u);
    if (s != null) {
        throw new MalformedURLException(s);
    }
    return u;
}
 
Example 11
Source File: URL.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a {@link java.net.URI} equivalent to this URL.
 * This method functions in the same way as {@code new URI (this.toString())}.
 * <p>Note, any URL instance that complies with RFC 2396 can be converted
 * to a URI. However, some URLs that are not strictly in compliance
 * can not be converted to a URI.
 *
 * @exception URISyntaxException if this URL is not formatted strictly according to
 *            to RFC2396 and cannot be converted to a URI.
 *
 * @return    a URI instance equivalent to this URL.
 * @since 1.5
 */
public URI toURI() throws URISyntaxException {
    URI uri = new URI(toString());
    if (authority != null && isBuiltinStreamHandler(handler)) {
        String s = IPAddressUtil.checkAuthority(this);
        if (s != null) throw new URISyntaxException(authority, s);
    }
    return uri;
}
 
Example 12
Source File: URL.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a {@link java.net.URI} equivalent to this URL.
 * This method functions in the same way as {@code new URI (this.toString())}.
 * <p>Note, any URL instance that complies with RFC 2396 can be converted
 * to a URI. However, some URLs that are not strictly in compliance
 * can not be converted to a URI.
 *
 * @exception URISyntaxException if this URL is not formatted strictly according to
 *            to RFC2396 and cannot be converted to a URI.
 *
 * @return    a URI instance equivalent to this URL.
 * @since 1.5
 */
public URI toURI() throws URISyntaxException {
    URI uri = new URI(toString());
    if (authority != null && isBuiltinStreamHandler(handler)) {
        String s = IPAddressUtil.checkAuthority(this);
        if (s != null) throw new URISyntaxException(authority, s);
    }
    return uri;
}
 
Example 13
Source File: URL.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a {@link java.net.URI} equivalent to this URL.
 * This method functions in the same way as {@code new URI (this.toString())}.
 * <p>Note, any URL instance that complies with RFC 2396 can be converted
 * to a URI. However, some URLs that are not strictly in compliance
 * can not be converted to a URI.
 *
 * @exception URISyntaxException if this URL is not formatted strictly according to
 *            to RFC2396 and cannot be converted to a URI.
 *
 * @return    a URI instance equivalent to this URL.
 * @since 1.5
 */
public URI toURI() throws URISyntaxException {
    URI uri = new URI(toString());
    if (authority != null && isBuiltinStreamHandler(handler)) {
        String s = IPAddressUtil.checkAuthority(this);
        if (s != null) throw new URISyntaxException(authority, s);
    }
    return uri;
}
 
Example 14
Source File: URL.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Returns a {@link java.net.URI} equivalent to this URL.
 * This method functions in the same way as {@code new URI (this.toString())}.
 * <p>Note, any URL instance that complies with RFC 2396 can be converted
 * to a URI. However, some URLs that are not strictly in compliance
 * can not be converted to a URI.
 *
 * @throws    URISyntaxException if this URL is not formatted strictly according to
 *            RFC2396 and cannot be converted to a URI.
 *
 * @return    a URI instance equivalent to this URL.
 * @since 1.5
 */
public URI toURI() throws URISyntaxException {
    URI uri = new URI(toString());
    if (authority != null && isBuiltinStreamHandler(handler)) {
        String s = IPAddressUtil.checkAuthority(this);
        if (s != null) throw new URISyntaxException(authority, s);
    }
    return uri;
}
 
Example 15
Source File: URL.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a {@link java.net.URI} equivalent to this URL.
 * This method functions in the same way as {@code new URI (this.toString())}.
 * <p>Note, any URL instance that complies with RFC 2396 can be converted
 * to a URI. However, some URLs that are not strictly in compliance
 * can not be converted to a URI.
 *
 * @exception URISyntaxException if this URL is not formatted strictly according to
 *            to RFC2396 and cannot be converted to a URI.
 *
 * @return    a URI instance equivalent to this URL.
 * @since 1.5
 */
public URI toURI() throws URISyntaxException {
    URI uri = new URI(toString());
    if (authority != null && isBuiltinStreamHandler(handler)) {
        String s = IPAddressUtil.checkAuthority(this);
        if (s != null) throw new URISyntaxException(authority, s);
    }
    return uri;
}