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.blossom.support; |
35 |
|
|
36 |
|
import info.magnolia.cms.util.ServletUtil; |
37 |
|
|
38 |
|
import java.util.Collections; |
39 |
|
import java.util.Enumeration; |
40 |
|
import java.util.LinkedHashMap; |
41 |
|
import java.util.Map; |
42 |
|
import javax.servlet.FilterConfig; |
43 |
|
import javax.servlet.ServletConfig; |
44 |
|
import javax.servlet.ServletContext; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@since |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 8 |
Complexity Density: 0.8 |
|
51 |
|
public class CustomFilterConfig implements FilterConfig { |
52 |
|
|
53 |
|
private String filterName; |
54 |
|
private ServletContext servletContext; |
55 |
|
private Map<String, String> initParameters; |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
57 |
0 |
public CustomFilterConfig(String filterName, ServletContext servletContext, Map<String, String> initParameters) {... |
58 |
0 |
this.filterName = filterName; |
59 |
0 |
this.servletContext = servletContext; |
60 |
0 |
this.initParameters = initParameters; |
61 |
|
} |
62 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
63 |
0 |
public CustomFilterConfig(String filterName, ServletContext servletContext) {... |
64 |
0 |
this(filterName, servletContext, new LinkedHashMap<String, String>()); |
65 |
|
} |
66 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
0 |
public CustomFilterConfig(FilterConfig config) {... |
68 |
0 |
this(config.getFilterName(), config.getServletContext(), ServletUtil.initParametersToMap(config)); |
69 |
|
} |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
0 |
public CustomFilterConfig(ServletConfig config) {... |
72 |
0 |
this(config.getServletName(), config.getServletContext(), ServletUtil.initParametersToMap(config)); |
73 |
|
} |
74 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
75 |
|
@Override... |
76 |
|
public String getFilterName() { |
77 |
|
return filterName; |
78 |
|
} |
79 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
80 |
|
@Override... |
81 |
|
public ServletContext getServletContext() { |
82 |
|
return servletContext; |
83 |
|
} |
84 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
0 |
@Override... |
86 |
|
public String getInitParameter(String name) { |
87 |
0 |
return initParameters.get(name); |
88 |
|
} |
89 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
90 |
|
@Override... |
91 |
|
public Enumeration getInitParameterNames() { |
92 |
|
return Collections.enumeration(initParameters.keySet()); |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0 |
public void addInitParameters(Map<String, String> map) {... |
96 |
0 |
this.initParameters.putAll(map); |
97 |
|
} |
98 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
0 |
public void addInitParameter(String name, String value) {... |
100 |
0 |
this.initParameters.put(name, value); |
101 |
|
} |
102 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
103 |
0 |
public String removeInitParameter(String name) {... |
104 |
0 |
return initParameters.remove(name); |
105 |
|
} |
106 |
|
} |