1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.internal.skin; |
21 |
|
|
22 |
|
import java.net.URL; |
23 |
|
|
24 |
|
import javax.inject.Provider; |
25 |
|
|
26 |
|
import org.xwiki.environment.Environment; |
27 |
|
import org.xwiki.skin.ResourceRepository; |
28 |
|
|
29 |
|
import com.xpn.xwiki.XWikiContext; |
30 |
|
import com.xpn.xwiki.web.XWikiURLFactory; |
31 |
|
|
32 |
|
|
33 |
|
@version |
34 |
|
@since |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 3 |
Complexity Density: 0.33 |
|
36 |
|
public class SkinEnvironmentResource extends AbstractEnvironmentResource |
37 |
|
{ |
38 |
|
protected Provider<XWikiContext> xcontextProvider; |
39 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
40 |
48058 |
public SkinEnvironmentResource(String path, String resourceName, ResourceRepository repository,... |
41 |
|
Environment environment, Provider<XWikiContext> xcontextProvider) |
42 |
|
{ |
43 |
48056 |
super(path, resourceName, repository, environment); |
44 |
|
|
45 |
48052 |
this.xcontextProvider = xcontextProvider; |
46 |
|
} |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
48 |
5394 |
@Override... |
49 |
|
public String getURL(boolean forceSkinAction) throws Exception |
50 |
|
{ |
51 |
5394 |
XWikiContext xcontext = this.xcontextProvider.get(); |
52 |
5394 |
XWikiURLFactory urlf = xcontext.getURLFactory(); |
53 |
|
|
54 |
5392 |
URL url; |
55 |
|
|
56 |
5393 |
if (forceSkinAction) { |
57 |
4329 |
url = urlf.createSkinURL(this.resourceName, "skins", getRepository().getId(), xcontext); |
58 |
|
} else { |
59 |
1063 |
url = urlf.createSkinURL(this.resourceName, getRepository().getId(), xcontext); |
60 |
|
} |
61 |
|
|
62 |
5394 |
return urlf.getURL(url, xcontext); |
63 |
|
} |
64 |
|
} |