本文整理汇总了Java中com.google.gwt.http.client.URL.decodePathSegment方法的典型用法代码示例。如果您正苦于以下问题:Java URL.decodePathSegment方法的具体用法?Java URL.decodePathSegment怎么用?Java URL.decodePathSegment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.http.client.URL
的用法示例。
在下文中一共展示了URL.decodePathSegment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
@Override
public String decode(String encodedValue) throws URIEncoderDecoder.EncodingException {
String ret = URL.decodePathSegment(encodedValue);
if (ret.indexOf(0xFFFD) != -1) {
throw new URIEncoderDecoder.EncodingException("Unable to decode value " + encodedValue
+ " it contains invalid UTF-8");
}
return ret;
}
示例2: projects
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
private static void projects(String token) {
String rest = skip(token);
int c = rest.indexOf(DASHBOARDS);
if (0 <= c) {
final String project = URL.decodePathSegment(rest.substring(0, c));
rest = rest.substring(c);
if (matchPrefix(DASHBOARDS, rest)) {
final String dashboardId = skip(rest);
GerritCallback<DashboardInfo> cb =
new GerritCallback<DashboardInfo>() {
@Override
public void onSuccess(DashboardInfo result) {
if (matchPrefix("/dashboard/", result.url())) {
String params = skip(result.url()).substring(1);
ProjectDashboardScreen dash =
new ProjectDashboardScreen(new Project.NameKey(project), params);
Gerrit.display(token, dash);
}
}
@Override
public void onFailure(Throwable caught) {
if ("default".equals(dashboardId) && RestApi.isNotFound(caught)) {
Gerrit.display(
PageLinks.toChangeQuery(
PageLinks.projectQuery(new Project.NameKey(project))));
} else {
super.onFailure(caught);
}
}
};
if ("default".equals(dashboardId)) {
DashboardList.getDefault(new Project.NameKey(project), cb);
return;
}
c = dashboardId.indexOf(":");
if (0 <= c) {
final String ref = URL.decodeQueryString(dashboardId.substring(0, c));
final String path = URL.decodeQueryString(dashboardId.substring(c + 1));
DashboardList.get(new Project.NameKey(project), ref + ":" + path, cb);
return;
}
}
}
Gerrit.display(token, new NotFoundScreen());
}
示例3: decodePathSegment
import com.google.gwt.http.client.URL; //导入方法依赖的package包/类
@Override
public String decodePathSegment(String encodedURLComponent) {
return URL.decodePathSegment(encodedURLComponent);
}