本文整理匯總了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);
}