remove unused method

This commit is contained in:
王劲鹏 2019-11-12 15:40:58 +08:00
parent c4e2c1e0dd
commit 261ae29042

View File

@ -37,10 +37,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import pub.doric.Doric; import pub.doric.Doric;
@ -237,21 +233,4 @@ public class DoricUtils {
} }
return sbar; return sbar;
} }
public static String getLocalIpAddress() {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements(); ) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
return inetAddress.getHostAddress().toString();
}
}
}
} catch (SocketException ex) {
System.out.println(ex);
}
return null;
}
} }