public class GeneralUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GENTLYWEB_EMAIL |
Constructor and Description |
---|
GeneralUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getExceptionTraceAsString(java.lang.Exception e)
Get an exception (and if it's an instance of
ChainException ) the chain of
exceptions (if present) as a String. |
static void |
getMethods(java.lang.Class c,
java.lang.String name,
int mods,
java.util.List ms) |
static void |
validateIPv4Address(java.lang.String ipaddress)
Validate an IPv4 address (string) passed in, it must conform to the following rules:
Must have 4 parts.
Parts must be separated by .
The first octet must be in the range 0-223.
The second and third octets must be in the range 0-255
4th octet can be either a number in the range 1-254 (0 is the name of the network, 255 is the
broadcast address).
All parts must be numbers...
|
public static java.lang.String getExceptionTraceAsString(java.lang.Exception e) throws java.io.IOException
ChainException
) the chain of
exceptions (if present) as a String.e
- The exceptionjava.io.IOException
- Should never happen since we are using a StringWriter.public static void validateIPv4Address(java.lang.String ipaddress) throws java.lang.Exception
ipaddress
- The ip address to validate.java.lang.Exception
- If one of the rules is broken.public static void getMethods(java.lang.Class c, java.lang.String name, int mods, java.util.List ms)