org.restlet.Request.setOriginalRef()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(142)

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

Request.setOriginalRef介绍

[英]Sets the original reference requested by the client.
[中]设置客户端请求的原始引用。

代码示例

代码示例来源:origin: org.restlet.osgi/org.restlet

@Override
public void setOriginalRef(Reference originalRef) {
  wrappedRequest.setOriginalRef(originalRef);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the original reference requested by the client.
 * 
 * @param originalRef
 *            The original reference.
 * @see Request#setOriginalRef(Reference)
 */
public void setOriginalRef(Reference originalRef) {
  getRequest().setOriginalRef(originalRef);
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Handles the call after resolving any URI template on the request's target
 * resource reference.
 * 
 * @param request
 *            The request to handle.
 * @param response
 *            The response to update.
 */
public int beforeHandle(Request request, Response response) {
  // Associate the response to the current thread
  Protocol protocol = request.getProtocol();
  if (protocol == null) {
    throw new UnsupportedOperationException(
        "Unable to determine the protocol to use for this call.");
  }
  String targetUri = request.getResourceRef().toString(true, false);
  if (targetUri.contains("{")) {
    // Template URI detected, create the template
    Template template = new Template(targetUri);
    // Set the formatted target URI
    request.setResourceRef(template.format(request, response));
  }
  request.setOriginalRef(ReferenceUtils.getOriginalRef(request.getResourceRef(), request.getHeaders()));
  return CONTINUE;
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

request.setOriginalRef(requestReference);
request.setResourceRef(requestReference);
Response response = new Response(request);

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

request.setOriginalRef(new Reference(DUMMY_ORIGINAL_REF));
Response response = new Response(request);
request.setResourceRef(new Reference(DUMMY_REFERENCE));

相关文章