Im adding password authentication to some code but I seem to have run into a problem. All of the requestPasswordAuthentication methods within the Authenticator class take an InetAddress object as an arg. I can't figure out how to get an instance of an InetAddres object just using a host name. The only methods that return a new instance are the following. With the last not returning an InetAddress but an IP address for the given host name.
I could use getByName(String host) to get the ip address then parse it into a byte array to use for getByAddress(byte[] addr) but that's really a pain.Code:static InetAddress getByAddress(byte[] addr) static InetAddress getByAddress(String host, byte[] addr) static InetAddress getByName(String host)




Reply With Quote