package com.qianwen.core.tool.utils;
|
|
import java.net.URI;
|
import java.net.URISyntaxException;
|
import java.nio.charset.Charset;
|
import org.springframework.web.util.UriUtils;
|
|
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/utils/UrlUtil.class */
|
public class UrlUtil extends UriUtils {
|
public static String encode(String source) {
|
return encode(source, Charsets.UTF_8);
|
}
|
|
public static String decode(String source) {
|
return decode(source, Charsets.UTF_8);
|
}
|
|
@Deprecated
|
public static String encodeURL(String source, Charset charset) {
|
return encode(source, charset.name());
|
}
|
|
@Deprecated
|
public static String decodeURL(String source, Charset charset) {
|
return decode(source, charset.name());
|
}
|
|
public static String getPath(String uriStr) {
|
try {
|
URI uri = new URI(uriStr);
|
return uri.getPath();
|
} catch (URISyntaxException var3) {
|
throw new RuntimeException(var3);
|
}
|
}
|
}
|