private void writeHostAndPortToFile(File portFile) { String host = socket.getInetAddress().getHostName(); int port = socket.getLocalPort(); // The motivation for the Log.warn would be better satisfied by Bug 38. Log.warn("echo " + host + ":" + port + " > " + portFile); StringUtilities.writeFile(portFile, host + ":" + port + "\n"); }