Java Code Examples for java.net.InetAddress#getAllByName0()
The following examples show how to use
java.net.InetAddress#getAllByName0() .
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: SocketPermission.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 2
Source File: SocketPermission.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 3
Source File: SocketPermission.java From jdk-1.7-annotated with Apache License 2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 4
Source File: SocketPermission.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 5
Source File: SocketPermission.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 6
Source File: SocketPermission.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 7
Source File: SocketPermission.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 8
Source File: SocketPermission.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 9
Source File: SocketPermission.java From Java8CN with Apache License 2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 10
Source File: SocketPermission.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 11
Source File: SocketPermission.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(':'); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 12
Source File: SocketPermission.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(':'); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 13
Source File: SocketPermission.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 14
Source File: SocketPermission.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 15
Source File: SocketPermission.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 16
Source File: SocketPermission.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 17
Source File: SocketPermission.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }
Example 18
Source File: SocketPermission.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * get IP addresses. Sets invalid to true if we can't get them. * */ void getIP() throws UnknownHostException { if (addresses != null || wildcard || invalid) return; try { // now get all the IP addresses String host; if (getName().charAt(0) == '[') { // Literal IPv6 address host = getName().substring(1, getName().indexOf(']')); } else { int i = getName().indexOf(":"); if (i == -1) host = getName(); else { host = getName().substring(0,i); } } addresses = new InetAddress[] {InetAddress.getAllByName0(host, false)[0]}; } catch (UnknownHostException uhe) { invalid = true; throw uhe; } catch (IndexOutOfBoundsException iobe) { invalid = true; throw new UnknownHostException(getName()); } }