info.informatica.net
Class InetUtil
java.lang.Object
info.informatica.net.InetUtil
public class InetUtil
- extends Object
Utility class with commonly-used network functions.
- Version:
- 1.02
- Author:
- amengual at informatica dot info
InetUtil
public InetUtil()
isInetAddress
public static boolean isInetAddress(String ipOrName)
- Performs a relaxed check to see if something is either a hostname or an
IPv4 address.
- Parameters:
ipOrName - the candidate hostname or IPv4 address
- Returns:
- false if the argument cannot be an IPv4 address, true otherwise
getUriFromUrl
public static String getUriFromUrl(String url)
- Gets the file from a URL. Similar to URL.getFile(), but avoids overhead.
- Parameters:
url - a String representing the URL to extract the file from
- Returns:
- a String with the file URI, or null if not recognized as URL or
there is no URI part on it