1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.xml.spring;
17
18 import static com.google.common.base.Preconditions.checkArgument;
19 import static com.google.common.base.Preconditions.checkNotNull;
20
21 import org.kuali.common.util.LocationUtils;
22 import org.kuali.common.util.project.ProjectUtils;
23 import org.kuali.common.util.project.model.ProjectResource;
24 import org.kuali.rice.xml.project.XmlProjectConstants;
25
26
27
28
29
30
31 public enum RiceXmlProperties {
32
33
34
35
36 DB(ProjectResource.classpath(XmlProjectConstants.ID, "db.properties")),
37
38
39
40
41 APP(ProjectResource.classpath(XmlProjectConstants.ID, "application-rice-properties.xml", true));
42
43 private final ProjectResource resource;
44
45 private RiceXmlProperties(ProjectResource resource) {
46 checkNotNull(resource, "'resource' cannot be null");
47 this.resource = resource;
48 String path = ProjectUtils.getPath(resource);
49 checkArgument(LocationUtils.exists(path), "[%s] does not exist", path);
50 }
51
52
53
54
55
56
57 public ProjectResource getResource() {
58 return resource;
59 }
60
61 }