@author SeanDragon Create By 2017-09-04 16:16
| 13 | * Create By 2017-09-04 16:16 |
| 14 | */ |
| 15 | public final class SecurityUrl { |
| 16 | public static String encode(String url, Charset charset) { |
| 17 | try { |
| 18 | return URLEncoder.encode(url, charset.name()); |
| 19 | } catch (UnsupportedEncodingException e) { |
| 20 | throw new RuntimeException(e); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | public static String encode(String url) { |
| 25 | return encode(url, StrConst.DEFAULT_CHARSET); |
| 26 | } |
| 27 | |
| 28 | public static String decode(String url, Charset charset) { |
| 29 | try { |
| 30 | return URLDecoder.decode(url, charset.name()); |
| 31 | } catch (UnsupportedEncodingException e) { |
| 32 | throw new RuntimeException(e); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | public static String decode(String url) { |
| 37 | return decode(url, StrConst.DEFAULT_CHARSET); |
| 38 | } |
| 39 | } |
nothing calls this directly
no outgoing calls
no test coverage detected