1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.api; |
21 |
|
|
22 |
|
import java.awt.image.BufferedImage; |
23 |
|
import java.io.IOException; |
24 |
|
import java.io.OutputStream; |
25 |
|
import java.util.Date; |
26 |
|
|
27 |
|
import com.xpn.xwiki.XWikiContext; |
28 |
|
import com.xpn.xwiki.plugin.image.ImageProcessor; |
29 |
|
import com.xpn.xwiki.web.Utils; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@version |
35 |
|
|
|
|
| 29% |
Uncovered Elements: 22 (31) |
Complexity: 14 |
Complexity Density: 0.82 |
|
36 |
|
public class Util extends Api |
37 |
|
{ |
38 |
|
|
39 |
|
private com.xpn.xwiki.XWiki xwiki; |
40 |
|
|
41 |
|
|
42 |
|
@link |
43 |
|
@link |
44 |
|
|
45 |
|
@param |
46 |
|
@param |
47 |
|
@see |
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
49 |
15661 |
public Util(com.xpn.xwiki.XWiki xwiki, XWikiContext context)... |
50 |
|
{ |
51 |
15673 |
super(context); |
52 |
15660 |
this.xwiki = xwiki; |
53 |
|
} |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
@param |
59 |
|
@return |
60 |
|
@since |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0 |
public String decodeURI(String text)... |
63 |
|
{ |
64 |
0 |
return com.xpn.xwiki.util.Util.decodeURI(text, this.context); |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
@link |
69 |
|
|
70 |
|
|
71 |
|
@return |
72 |
|
@since |
73 |
|
@deprecated |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
@Deprecated... |
76 |
|
public Date getDate() |
77 |
|
{ |
78 |
0 |
return new Date(); |
79 |
|
} |
80 |
|
|
81 |
|
|
82 |
|
@link |
83 |
|
|
84 |
|
|
85 |
|
@param |
86 |
|
@return@link |
87 |
|
@since |
88 |
|
@deprecated |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0 |
@Deprecated... |
91 |
|
public Date getDate(long time) |
92 |
|
{ |
93 |
0 |
return new Date(time); |
94 |
|
} |
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
@param |
101 |
|
@return |
102 |
|
@since |
103 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
0 |
public int getTimeDelta(long time)... |
105 |
|
{ |
106 |
0 |
return this.xwiki.getTimeDelta(time); |
107 |
|
} |
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
@param |
113 |
|
@return |
114 |
|
@since |
115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
0 |
public String printStrackTrace(Throwable e)... |
117 |
|
{ |
118 |
0 |
return this.xwiki.printStrackTrace(e); |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
@param |
125 |
|
@return |
126 |
|
@since |
127 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
51 |
public String generateRandomString(int size)... |
129 |
|
{ |
130 |
51 |
return this.xwiki.generateRandomString(size); |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
@param |
139 |
|
@throws |
140 |
|
@since |
141 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
142 |
0 |
public void outputImage(BufferedImage image) throws IOException... |
143 |
|
{ |
144 |
0 |
OutputStream ostream = getXWikiContext().getResponse().getOutputStream(); |
145 |
0 |
Utils.getComponent(ImageProcessor.class).writeImage(image, "image/jpeg", (float) 0.8, ostream); |
146 |
0 |
ostream.flush(); |
147 |
|
} |
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
@return |
153 |
|
@since |
154 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
155 |
0 |
public Object getNull()... |
156 |
|
{ |
157 |
0 |
return null; |
158 |
|
} |
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
@return |
165 |
|
@since |
166 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
167 |
120 |
public String getNewline()... |
168 |
|
{ |
169 |
120 |
return "\n"; |
170 |
|
} |
171 |
|
|
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
@param |
176 |
|
@return |
177 |
|
@since |
178 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
179 |
0 |
public Boolean parseBoolean(String str)... |
180 |
|
{ |
181 |
0 |
return Boolean.parseBoolean(str); |
182 |
|
} |
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|
187 |
|
@param |
188 |
|
@return |
189 |
|
@since |
190 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
191 |
0 |
public String clearAccents(String text)... |
192 |
|
{ |
193 |
0 |
return com.xpn.xwiki.util.Util.noaccents(text); |
194 |
|
} |
195 |
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
|
@param |
200 |
|
@return |
201 |
|
@since |
202 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
203 |
0 |
public String clearName(String documentName)... |
204 |
|
{ |
205 |
0 |
return this.xwiki.clearName(documentName, getXWikiContext()); |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
|
212 |
|
@param |
213 |
|
@return |
214 |
|
@since |
215 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
216 |
31 |
public String convertToAlphaNumeric(String text)... |
217 |
|
{ |
218 |
31 |
return com.xpn.xwiki.util.Util.convertToAlphaNumeric(text); |
219 |
|
} |
220 |
|
} |