public class ExceptionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertExists(java.io.File file) |
static void |
assertExists(java.nio.file.Path path) |
static void |
assertIsDirectory(java.io.File file) |
static void |
assertIsDirectory(java.nio.file.Path path) |
static void |
assertIsFile(java.io.File file) |
static void |
assertIsFile(java.nio.file.Path path) |
static void |
assertNegative(long value,
java.lang.String name) |
static <T> T |
assertNotNull(T value,
java.lang.String name) |
static void |
assertNotZeroLength(java.lang.String value,
java.lang.String name) |
static void |
assertPositive(long value,
java.lang.String name) |
static java.lang.String |
getMessage(java.lang.Throwable e)
Gets the message for an exception taking into consideration that
not all exceptions (ie NPE) will have a message in which case the
class's name will be used in lue of no message.
|
static java.lang.Throwable |
getRootCause(java.lang.Throwable e) |
static java.util.List<? extends java.lang.Throwable> |
getRootCauses(java.lang.Throwable e) |
static java.lang.String |
getRootMessage(java.lang.Throwable e)
Gets the message for an exception's root exception taking into
consideration that not all exceptions (ie NPE) will have a message
in which case the class's name will be used in lue of no message.
|
static java.lang.String |
getStackTrace(java.lang.Throwable e) |
public static void assertIsFile(java.nio.file.Path path)
throws java.io.IOException
java.io.IOExceptionpublic static void assertIsFile(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic static void assertIsDirectory(java.nio.file.Path path)
throws java.io.IOException
java.io.IOExceptionpublic static void assertIsDirectory(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic static void assertExists(java.nio.file.Path path)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic static void assertExists(java.io.File file)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic static void assertNotZeroLength(java.lang.String value,
java.lang.String name)
public static <T> T assertNotNull(T value,
java.lang.String name)
public static void assertPositive(long value,
java.lang.String name)
public static void assertNegative(long value,
java.lang.String name)
public static java.lang.Throwable getRootCause(java.lang.Throwable e)
public static java.lang.String getMessage(java.lang.Throwable e)
public static java.lang.String getRootMessage(java.lang.Throwable e)
public static java.lang.String getStackTrace(java.lang.Throwable e)
public static java.util.List<? extends java.lang.Throwable> getRootCauses(java.lang.Throwable e)