com.ksyun.api.sdk.auth.KscURLEncoder Maven / Gradle / Ivy
package com.ksyun.api.sdk.auth;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class KscURLEncoder {
public final static String URL_ENCODING = "UTF-8";
public static String encode(String value) throws UnsupportedEncodingException {
return URLEncoder.encode(value, URL_ENCODING);
}
public static String percentEncode(String value) throws UnsupportedEncodingException{
return value != null ? URLEncoder.encode(value, URL_ENCODING).replace("+", "%20")
.replace("*", "%2A").replace("%7E", "~") : null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy