|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.hermesftp.utils.NetUtils
public final class NetUtils
Utility methods that facilitate networking.
Method Summary | |
---|---|
static boolean |
checkIPMatch(java.lang.String ipTemplateList,
java.net.InetAddress addr)
Checks if the passed IP address complies to a given pattern. |
static boolean |
checkIPv4Match(java.lang.String ipTemplateList,
java.lang.String ipStr)
Checks if the passed IPv4 complies to a given pattern. |
static boolean |
checkIPv6Match(java.lang.String ipTemplateList,
java.lang.String ipStr)
Checks if the passed IPv6 complies to a given pattern. |
static java.net.InetAddress |
getMachineAddress(boolean fallBackToLocalhost)
Returns the machine's network address. |
static java.net.InetAddress |
getMachineAddress(java.net.NetworkInterface ni)
Returns the network address of a particular network interface. |
static boolean |
isIPv6(java.net.InetAddress addr)
Checks the IP protocol version (IPv4 or IPv6) |
static boolean |
isSSLAvailable()
Checks if SSL is available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.net.InetAddress getMachineAddress(boolean fallBackToLocalhost)
fallBackToLocalhost
- True if loopback address should be used if
there is no net.
public static boolean isIPv6(java.net.InetAddress addr)
addr
- The address to check.
public static java.net.InetAddress getMachineAddress(java.net.NetworkInterface ni)
ni
- The network interface.
public static boolean isSSLAvailable()
public static boolean checkIPMatch(java.lang.String ipTemplateList, java.net.InetAddress addr)
ipTemplateList
- String list of patterns. Wild cards are allowed: 192.168.*.*, 127.0.0.1, !85.0.0.0ip
- The IP address to check.
public static boolean checkIPv4Match(java.lang.String ipTemplateList, java.lang.String ipStr)
ipTemplateList
- String list of patterns. Wild cards are allowed: 192.168.*.*, 127.0.0.1, !85.0.0.0ipStr
- The IP address to check.
public static boolean checkIPv6Match(java.lang.String ipTemplateList, java.lang.String ipStr)
ipTemplateList
- String list of patterns. Wild cards are allowed.ipStr
- The IP address to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |