org.apache.shindig.common.uri.UriBuilder.splitParameters()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.shindig.common.uri.UriBuilder.splitParameters()方法的一些代码示例,展示了UriBuilder.splitParameters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UriBuilder.splitParameters()方法的具体详情如下:
包路径:org.apache.shindig.common.uri.UriBuilder
类名称:UriBuilder
方法名:splitParameters

UriBuilder.splitParameters介绍

[英]Utility method for splitting a parameter string into key / value pairs.
[中]将参数字符串拆分为键/值对的实用方法。

代码示例

代码示例来源:origin: org.wso2.org.apache.shindig/shindig-common

/**
 * Assigns the specified query string as the query portion of the uri, automatically decoding
 * parameters to populate the parameter map for calls to getParameter.
 */
public void setString(String str) {
 params.clear();
 params.putAll(splitParameters(str));
 this.str = str;
}

代码示例来源:origin: org.gatein.shindig/shindig-common

/**
 * Assigns the specified query string as the query portion of the uri, automatically decoding
 * parameters to populate the parameter map for calls to getParameter.
 */
public void setString(String str) {
 params.clear();
 params.putAll(splitParameters(str));
 this.str = str;
}

代码示例来源:origin: com.lmco.shindig/shindig-common

/**
 * Assigns the specified query string as the query portion of the uri, automatically decoding
 * parameters to populate the parameter map for calls to getParameter.
 */
public void setString(String str) {
 params.clear();
 params.putAll(splitParameters(str));
 this.str = str;
}

代码示例来源:origin: org.apache.shindig/shindig-common

/**
 * Assigns the specified query string as the query portion of the uri, automatically decoding
 * parameters to populate the parameter map for calls to getParameter.
 */
public void setString(String str) {
 params.clear();
 params.putAll(splitParameters(str));
 this.str = str;
}

代码示例来源:origin: apache/shindig

/**
 * Assigns the specified query string as the query portion of the uri, automatically decoding
 * parameters to populate the parameter map for calls to getParameter.
 */
public void setString(String str) {
 params.clear();
 params.putAll(splitParameters(str));
 this.str = str;
}

代码示例来源:origin: com.lmco.shindig/shindig-gadgets

@Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
  OAuthCallbackState callbackState = new OAuthCallbackState(stateCrypter,
    req.getParameter(CALLBACK_STATE_PARAM));
  if (callbackState.getRealCallbackUrl() != null) {
   // Copy the query parameters from this URL over to the real URL.
   UriBuilder realUri = UriBuilder.parse(callbackState.getRealCallbackUrl());
   Map<String, List<String>> params = UriBuilder.splitParameters(req.getQueryString());
   for (Map.Entry<String, List<String>> entry : params.entrySet()) {
    realUri.putQueryParameter(entry.getKey(), entry.getValue());
   }
   realUri.removeQueryParameter(CALLBACK_STATE_PARAM);
   HttpUtil.setCachingHeaders(resp, ONE_HOUR_IN_SECONDS, true);
   resp.sendRedirect(realUri.toString());
   return;
  }
  HttpUtil.setCachingHeaders(resp, ONE_HOUR_IN_SECONDS, true);
  resp.setContentType("text/html; charset=UTF-8");
  resp.getWriter().write(RESP_BODY);
 }
}

代码示例来源:origin: org.apache.shindig/shindig-gadgets

@Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
  OAuthCallbackState callbackState = new OAuthCallbackState(stateCrypter,
    req.getParameter(CALLBACK_STATE_PARAM));
  if (callbackState.getRealCallbackUrl() != null) {
   // Copy the query parameters from this URL over to the real URL.
   UriBuilder realUri = UriBuilder.parse(callbackState.getRealCallbackUrl());
   Map<String, List<String>> params = UriBuilder.splitParameters(req.getQueryString());
   for (Map.Entry<String, List<String>> entry : params.entrySet()) {
    realUri.putQueryParameter(entry.getKey(), entry.getValue());
   }
   realUri.removeQueryParameter(CALLBACK_STATE_PARAM);
   HttpUtil.setCachingHeaders(resp, ONE_HOUR_IN_SECONDS, true);
   resp.sendRedirect(realUri.toString());
   return;
  }
  HttpUtil.setCachingHeaders(resp, ONE_HOUR_IN_SECONDS, true);
  resp.setContentType("text/html; charset=UTF-8");
  resp.getWriter().write(RESP_BODY);
 }
}

代码示例来源:origin: org.gatein.shindig/shindig-gadgets

@Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
  OAuthCallbackState callbackState = new OAuthCallbackState(stateCrypter,
    req.getParameter(CALLBACK_STATE_PARAM));
  if (callbackState.getRealCallbackUrl() != null) {
   // Copy the query parameters from this URL over to the real URL.
   UriBuilder realUri = UriBuilder.parse(callbackState.getRealCallbackUrl());
   Map<String, List<String>> params = UriBuilder.splitParameters(req.getQueryString());
   for (Map.Entry<String, List<String>> entry : params.entrySet()) {
    realUri.putQueryParameter(entry.getKey(), entry.getValue());
   }
   realUri.removeQueryParameter(CALLBACK_STATE_PARAM);
   HttpUtil.setCachingHeaders(resp, ONE_HOUR_IN_SECONDS, true);
   resp.sendRedirect(realUri.toString());
   return;
  }
  HttpUtil.setCachingHeaders(resp, ONE_HOUR_IN_SECONDS, true);
  resp.setContentType("text/html; charset=UTF-8");
  resp.getWriter().write(RESP_BODY);
 }
}

相关文章