本文整理汇总了Java中com.alibaba.dubbo.common.URL.decode方法的典型用法代码示例。如果您正苦于以下问题:Java URL.decode方法的具体用法?Java URL.decode怎么用?Java URL.decode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.dubbo.common.URL
的用法示例。
在下文中一共展示了URL.decode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseMock
import com.alibaba.dubbo.common.URL; //导入方法依赖的package包/类
private String[] parseMock(String mock) {
mock = URL.decode(mock);
String force;
if (mock.startsWith("force:")) {
force = "force";
mock = mock.substring("force:".length());
} else if (mock.startsWith("fail:")) {
force = "fail";
mock = mock.substring("fail:".length());
} else {
force = "fail";
}
String[] tokens = new String[2];
tokens[0] = force;
tokens[1] = mock;
return tokens;
}
示例2: show
import com.alibaba.dubbo.common.URL; //导入方法依赖的package包/类
public void show(Long id, Map<String, Object> context) {
Override override = overrideService.findById(id);
Map<String, String> parameters = parseQueryString(override.getParams());
if(parameters.get(DEFAULT_MOCK_JSON_KEY) != null) {
String mock = URL.decode(parameters.get(DEFAULT_MOCK_JSON_KEY));
String[] tokens = parseMock(mock);
context.put(FORM_DEFAULT_MOCK_METHOD_FORCE, tokens[0]);
context.put(FORM_DEFAULT_MOCK_METHOD_JSON, tokens[1]);
parameters.remove(DEFAULT_MOCK_JSON_KEY);
}
Map<String, String> method2Force = new LinkedHashMap<String, String>();
Map<String, String> method2Json = new LinkedHashMap<String, String>();
for (Iterator<Map.Entry<String, String>> iterator = parameters.entrySet().iterator(); iterator.hasNext();) {
Map.Entry<String, String> e = iterator.next();
String key = e.getKey();
if(key.endsWith(MOCK_JSON_KEY_POSTFIX)) {
String m = key.substring(0, key.length() - MOCK_JSON_KEY_POSTFIX.length());
parseMock(m, e.getValue(), method2Force, method2Json);
iterator.remove();
}
}
context.put("methodForces", method2Force);
context.put("methodJsons", method2Json);
context.put("parameters", parameters);
context.put("override", override);
}
示例3: toUrlsWithoutEmpty
import com.alibaba.dubbo.common.URL; //导入方法依赖的package包/类
private List<URL> toUrlsWithoutEmpty(URL consumer, List<String> providers) {
List<URL> urls = new ArrayList<URL>();
if (providers != null && providers.size() > 0) {
for (String provider : providers) {
provider = URL.decode(provider);
if (provider.contains("://")) {
URL url = URL.valueOf(provider);
if (UrlUtils.isMatch(consumer, url)) {
urls.add(url);
}
}
}
}
return urls;
}
示例4: toUrlsWithoutEmpty
import com.alibaba.dubbo.common.URL; //导入方法依赖的package包/类
private List<URL> toUrlsWithoutEmpty(URL consumer, List<String> providers) {
List<URL> urls = new ArrayList<URL>();
if (providers != null && providers.size() > 0) {
for (String provider : providers) {
provider = URL.decode(provider);
if (provider.contains("://")) {
URL url = URL.valueOf(provider);
if (UrlUtils.isMatch(consumer, url)) {
urls.add(url);
}
}
}
}
return urls;
}
示例5: decodeUrl
import com.alibaba.dubbo.common.URL; //导入方法依赖的package包/类
public static String decodeUrl(String url) {
return URL.decode(url);
}