本文整理了Java中org.restlet.Request.setOriginalRef
方法的一些代码示例,展示了Request.setOriginalRef
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setOriginalRef
方法的具体详情如下:
包路径:org.restlet.Request
类名称: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));
内容来源于网络,如有侵权,请联系作者删除!