1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.environment; |
21 |
|
|
22 |
|
import java.io.File; |
23 |
|
|
24 |
|
import org.xwiki.component.embed.EmbeddableComponentManager; |
25 |
|
import org.xwiki.component.manager.ComponentLookupException; |
26 |
|
import org.xwiki.component.manager.ComponentManager; |
27 |
|
import org.xwiki.environment.internal.StandardEnvironment; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 81.5% |
Uncovered Elements: 5 (27) |
Complexity: 10 |
Complexity Density: 0.59 |
|
35 |
|
public final class System |
36 |
|
{ |
37 |
|
|
38 |
|
|
39 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
40 |
0 |
private System()... |
41 |
|
{ |
42 |
|
|
43 |
|
} |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
@param@link |
51 |
|
@return |
52 |
|
@see |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
public static ComponentManager initialize(ClassLoader classLoader)... |
55 |
|
{ |
56 |
0 |
return initialize(null, null, null, classLoader); |
57 |
|
} |
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
@return |
65 |
|
@see |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
30 |
public static ComponentManager initialize()... |
68 |
|
{ |
69 |
30 |
return initialize((File) null); |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
@param@link |
78 |
|
@return |
79 |
|
@see |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
30 |
public static ComponentManager initialize(File permanentDirectory)... |
82 |
|
{ |
83 |
30 |
return initialize(permanentDirectory, null); |
84 |
|
} |
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
@param@link |
91 |
|
@param |
92 |
|
@link |
93 |
|
@return |
94 |
|
@see |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
30 |
public static ComponentManager initialize(File permanentDirectory, File resourceDirectory)... |
97 |
|
{ |
98 |
30 |
return initialize(permanentDirectory, resourceDirectory, null); |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
@param@link |
106 |
|
@param |
107 |
|
@link |
108 |
|
@param@link |
109 |
|
@return |
110 |
|
@see |
111 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
31 |
public static ComponentManager initialize(File permanentDirectory, File resourceDirectory, File temporaryDirectory)... |
113 |
|
{ |
114 |
31 |
return initialize(permanentDirectory, resourceDirectory, temporaryDirectory, null); |
115 |
|
} |
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
@param@link |
121 |
|
@param |
122 |
|
@link |
123 |
|
@param@link |
124 |
|
@param@link |
125 |
|
@return |
126 |
|
@see |
127 |
|
|
|
|
| 83.3% |
Uncovered Elements: 2 (12) |
Complexity: 3 |
Complexity Density: 0.3 |
|
128 |
31 |
public static ComponentManager initialize(File permanentDirectory, File resourceDirectory, File temporaryDirectory,... |
129 |
|
ClassLoader classLoader) |
130 |
|
{ |
131 |
|
|
132 |
31 |
EmbeddableComponentManager ecm = new EmbeddableComponentManager(); |
133 |
31 |
ecm.initialize(classLoader == null ? System.class.getClassLoader() : classLoader); |
134 |
|
|
135 |
|
|
136 |
31 |
StandardEnvironment environment; |
137 |
31 |
try { |
138 |
31 |
environment = ecm.getInstance(Environment.class); |
139 |
|
} catch (ComponentLookupException e) { |
140 |
0 |
throw new RuntimeException("Failed to find Standard Environment", e); |
141 |
|
} |
142 |
31 |
environment.setPermanentDirectory(permanentDirectory); |
143 |
31 |
environment.setResourceDirectory(resourceDirectory); |
144 |
31 |
environment.setTemporaryDirectory(temporaryDirectory); |
145 |
|
|
146 |
31 |
return ecm; |
147 |
|
} |
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
@param |
153 |
|
@since |
154 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
155 |
29 |
public static void dispose(ComponentManager componentManager)... |
156 |
|
{ |
157 |
29 |
EmbeddableComponentManager ecm = (EmbeddableComponentManager) componentManager; |
158 |
29 |
ecm.dispose(); |
159 |
|
} |
160 |
|
} |