1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.util.main;
17
18 import org.kuali.common.util.Assert;
19 import org.kuali.common.util.LocationUtils;
20 import org.kuali.common.util.execute.Executable;
21
22
23
24
25 public final class ValidatePropertiesLocationExecutable implements Executable {
26
27 public ValidatePropertiesLocationExecutable(MainContext context, String message) {
28 Assert.noNulls(context);
29 Assert.noBlanks(message);
30 this.context = context;
31 this.message = message;
32 }
33
34 private final String message;
35 private final MainContext context;
36
37 @Override
38 public void execute() {
39 String[] args = context.getArgs();
40 Assert.notNull(args, message);
41 Assert.isTrue(args.length > 0, message);
42 String location = args[0];
43 Assert.noBlanks(message, location);
44 LocationUtils.validateLocation(location, message);
45 }
46
47 public String getMessage() {
48 return message;
49 }
50
51 public MainContext getContext() {
52 return context;
53 }
54
55 }