1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.googlecode.t7mp;
17
18
19
20
21 public class TomcatSetupException extends RuntimeException {
22
23 private static final long serialVersionUID = 1L;
24
25 private static final String NOT_NULL = " should not be null";
26
27 private static final String NOT_EMPTY = " should not be empty";
28
29 public TomcatSetupException(String message) {
30 super(message);
31 }
32
33 public TomcatSetupException(String message, Throwable cause) {
34 super(message, cause);
35 }
36
37 public static void notNull(Object arg, String name) {
38 if (arg == null) {
39 throw new TomcatSetupException(name + NOT_NULL);
40 }
41 }
42
43 public static void notEmpty(String string, String name) {
44 if (string.isEmpty()) {
45 throw new TomcatSetupException(name + NOT_EMPTY);
46 }
47 }
48 }