当前位置: 首页>>代码示例>>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;未经允许,请勿转载。