當前位置: 首頁>>代碼示例>>Java>>正文


Java URL.decodePathSegment方法代碼示例

本文整理匯總了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;
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:10,代碼來源:ClientPercentEncoderDecoder.java

示例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());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:48,代碼來源:Dispatcher.java

示例3: decodePathSegment

import com.google.gwt.http.client.URL; //導入方法依賴的package包/類
@Override
public String decodePathSegment(String encodedURLComponent) {
    return URL.decodePathSegment(encodedURLComponent);
}
 
開發者ID:reinert,項目名稱:requestor,代碼行數:5,代碼來源:UrlCodecImpl.java


注:本文中的com.google.gwt.http.client.URL.decodePathSegment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。