1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.module.resources.setup; |
35 |
|
|
36 |
|
import info.magnolia.cms.util.ClasspathResourcesUtil; |
37 |
|
import info.magnolia.module.InstallContext; |
38 |
|
import info.magnolia.module.delta.AbstractRepositoryTask; |
39 |
|
import info.magnolia.module.delta.TaskExecutionException; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
|
|
| 80% |
Uncovered Elements: 4 (20) |
Complexity: 7 |
Complexity Density: 0.58 |
|
44 |
|
public class InstallBinaryResourcesTask extends AbstractRepositoryTask { |
45 |
|
|
46 |
|
protected String pattern; |
47 |
|
protected boolean preserveResourcesParameters; |
48 |
|
private boolean stripExtension; |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
2 |
public InstallBinaryResourcesTask(String pattern) {... |
51 |
2 |
this("Install binary resources", "Installs all resources matching the " + pattern + " pattern.", pattern, false); |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
public InstallBinaryResourcesTask(String pattern, boolean preserveResourcesParameters) {... |
55 |
0 |
this("Install binary resources", "Installs all resources matching the " + pattern + " pattern.", pattern, preserveResourcesParameters); |
56 |
|
} |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
2 |
public InstallBinaryResourcesTask(String taskName, String taskDescription, String pattern, boolean preserveResourcesParameters) {... |
59 |
2 |
this(taskName, taskDescription, pattern, preserveResourcesParameters, true); |
60 |
|
} |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
62 |
3 |
public InstallBinaryResourcesTask(String taskName, String taskDescription, String pattern, boolean preserveResourcesParameters, boolean stripExtension) {... |
63 |
3 |
super(taskName, taskDescription); |
64 |
3 |
this.pattern = pattern; |
65 |
3 |
this.preserveResourcesParameters = preserveResourcesParameters; |
66 |
3 |
this.stripExtension = stripExtension; |
67 |
|
} |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
69 |
3 |
@Override... |
70 |
|
public void doExecute(InstallContext ctx) throws TaskExecutionException { |
71 |
3 |
final String[] resources = findResources(); |
72 |
|
|
73 |
9 |
for (int i = 0; i < resources.length; i++) { |
74 |
6 |
String resource = resources[i]; |
75 |
6 |
new InstallBinaryResourceTask(resource, null, null, null, preserveResourcesParameters, stripExtension).execute(ctx); |
76 |
|
} |
77 |
|
} |
78 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
79 |
0 |
protected String[] findResources() {... |
80 |
0 |
return ClasspathResourcesUtil.findResources(pattern); |
81 |
|
} |
82 |
|
|
83 |
|
} |