Changeset 8337 in josm for trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
- Timestamp:
- 2015-05-06T20:05:57+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
r7834 r8337 4 4 import java.io.File; 5 5 import java.net.InetAddress; 6 import java.net.Inet4Address; 7 import java.net.Inet6Address; 6 8 import java.net.UnknownHostException; 7 9 … … 83 85 * @since 7800 84 86 */ 87 @Deprecated 85 88 public static InetAddress getInetAddress() throws UnknownHostException { 86 89 // Return an address to the loopback interface by default 87 90 return InetAddress.getByName(Main.pref.get("remote.control.host", null)); 88 91 } 92 93 /** 94 * Returns the IPv6 address used for remote control. 95 * @return the IPv6 address used for remote control 96 * @throws UnknownHostException if the local host name could not be resolved into an address. 97 * @since 8337 98 */ 99 public static InetAddress getInet6Address() throws UnknownHostException { 100 for(InetAddress a : InetAddress.getAllByName(Main.pref.get("remote.control.host", "localhost"))) { 101 if(a instanceof Inet6Address) { 102 return a; 103 } 104 }; 105 throw new UnknownHostException(); 106 } 107 108 /** 109 * Returns the IPv4 address used for remote control. 110 * @return the IPv4 address used for remote control 111 * @throws UnknownHostException if the local host name could not be resolved into an address. 112 * @since 8337 113 */ 114 public static InetAddress getInet4Address() throws UnknownHostException { 115 // Return an address to the loopback interface by default 116 for(InetAddress a : InetAddress.getAllByName(Main.pref.get("remote.control.host", "localhost"))) { 117 if(a instanceof Inet4Address) { 118 return a; 119 } 120 }; 121 throw new UnknownHostException(); 122 } 89 123 }
Note:
See TracChangeset
for help on using the changeset viewer.