parseListOfInetAddresses
public static List<InetAddress[]> parseListOfInetAddresses(String list)
Parses the specified comma-separated list of allowed
ip addresses, ip-address ranges, or host names.
For example, "1.2.3.4" sets the list to consist of only the ip address of 1.2.3.4
[ [1.2.3.4, 1.2.3.4] ];
"1.2.3.4-5.6.7.8" sets the list to consist of the ip addresses
greater than or equal to 1.2.3.4 and less than or equal to 5.6.7.8
[ [1.2.3.4, 5.6.7.8] ];
"localhost,10.140.58.1-10.140.58.31,pc1.private.corp.com" sets the list
to consist of localhost, pc1.private.corp.com, and the ip addresses
greater than or equal to 10.140.58.1 and less than or equal to 10.140.58.3.
[ [localhost, localhost], [10.140.58.1, 10.140.58.31], [pc1.private.corp.com, pc1.private.corp.com] ].
Null or empty string ("") sets the list to an empty list [].
- Parameters:
list
- Comma-separated list of allowed addresses.
- Returns:
- List of
InetAddress
pairs; never null.