17
17
18
18
import lombok .experimental .UtilityClass ;
19
19
20
- import java .io .UnsupportedEncodingException ;
21
-
22
20
import org .springframework .util .Assert ;
23
21
import org .springframework .web .util .UriUtils ;
24
22
25
23
/**
26
24
* Utilities for URI encoding.
27
25
*
28
26
* @author Oliver Gierke
27
+ * @author Greg Turnquist
29
28
* @since 0.22
30
29
* @soundtrack Don Philippe - Between Now And Now (Between Now And Now)
31
30
*/
@@ -46,8 +45,8 @@ public static String encodePath(Object source) {
46
45
47
46
try {
48
47
return UriUtils .encodePath (source .toString (), ENCODING );
49
- } catch (UnsupportedEncodingException o_O ) {
50
- throw new IllegalStateException ( o_O );
48
+ } catch (Throwable e ) {
49
+ throw new RuntimeException ( e );
51
50
}
52
51
}
53
52
@@ -63,8 +62,8 @@ public static String encodeParameter(Object source) {
63
62
64
63
try {
65
64
return UriUtils .encodeQueryParam (source .toString (), ENCODING );
66
- } catch (UnsupportedEncodingException o_O ) {
67
- throw new IllegalStateException ( o_O );
65
+ } catch (Throwable e ) {
66
+ throw new RuntimeException ( e );
68
67
}
69
68
}
70
69
@@ -80,8 +79,8 @@ public static String encodeFragment(Object source) {
80
79
81
80
try {
82
81
return UriUtils .encodeFragment (source .toString (), ENCODING );
83
- } catch (UnsupportedEncodingException o_O ) {
84
- throw new IllegalStateException ( o_O );
82
+ } catch (Throwable e ) {
83
+ throw new RuntimeException ( e );
85
84
}
86
85
}
87
86
}
0 commit comments