Package edu.uiuc.ncsa.security.core.util
Class HostUtil
- java.lang.Object
-
- edu.uiuc.ncsa.security.core.util.HostUtil
-
public class HostUtil extends Object
Utility for looking up a host. Mostly a facade to make life easier.Created by Jeff Gaynor
on 10/22/13 at 11:48 AM
-
-
Constructor Summary
Constructors Constructor Description HostUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcanonicalName(String hostName)This is the *real* host.static StringreverseLookup(byte[] address)The address is either 4 bytes (IpV 4) or 16 bytes (IpV 6).static StringreverseLookup(String dottedQuadAddress)
-
-
-
Method Detail
-
canonicalName
public static String canonicalName(String hostName) throws UnknownHostException
This is the *real* host. The user may set the host property but this should be used internally since it will do any reverse lookups needed.- Returns:
- Throws:
UnknownHostException
-
reverseLookup
public static String reverseLookup(byte[] address) throws UnknownHostException
The address is either 4 bytes (IpV 4) or 16 bytes (IpV 6). This returns the name associated with the address or throws an exception if no such name is known- Parameters:
address-- Returns:
- Throws:
UnknownHostException
-
reverseLookup
public static String reverseLookup(String dottedQuadAddress) throws UnknownHostException
- Throws:
UnknownHostException
-
-