MCPcopy Create free account
hub / github.com/SeanDragon/protools / SecurityUrl

Class SecurityUrl

security/src/main/java/pro/tools/security/SecurityUrl.java:15–39  ·  view source on GitHub ↗

@author SeanDragon Create By 2017-09-04 16:16

Source from the content-addressed store, hash-verified

13 * Create By 2017-09-04 16:16
14 */
15public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected