本文整理了Java中org.restlet.data.Reference.setBaseRef
方法的一些代码示例,展示了Reference.setBaseRef
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.setBaseRef
方法的具体详情如下:
包路径:org.restlet.data.Reference
类名称:Reference
方法名:setBaseRef
[英]Sets the base reference for relative references.
[中]设置相对参照的基准参照。
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Sets the base reference for relative references.
*
* @param baseUri
* The base URI for relative references.
*/
public void setBaseRef(String baseUri) {
setBaseRef(new Reference(baseUri));
}
代码示例来源:origin: org.restlet/org.restlet
/**
* Sets the base reference for relative references.
*
* @param baseUri
* The base URI for relative references.
*/
public void setBaseRef(String baseUri) {
setBaseRef(new Reference(baseUri));
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
/**
* Sets the base reference for relative references.
*
* @param baseUri
* The base URI for relative references.
*/
public void setBaseRef(String baseUri) {
setBaseRef(new Reference(baseUri));
}
代码示例来源:origin: org.restlet.osgi/org.restlet
@Override
public int beforeHandle(Request request, Response response) {
int result = super.beforeHandle(request, response);
// This causes the baseRef of the resource reference to be set
// as if it had actually arrived from a server connector.
request.getResourceRef().setBaseRef(
request.getResourceRef().getHostIdentifier());
return result;
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
"The root reference of the request must not be null");
referenceOriginal.setBaseRef(appRootRef);
this.referenceCut = referenceCut;
this.referenceOriginal = referenceOriginal;
代码示例来源:origin: org.restlet.osgi/org.restlet
/**
* Allows filtering before processing by the next Restlet. Set the base
* reference.
*
* @param request
* The request to handle.
* @param response
* The response to update.
* @return The continuation status.
*/
@Override
protected int beforeHandle(Request request, Response response) {
if (request.getHostRef() == null) {
request.getResourceRef().setBaseRef(
request.getResourceRef().getHostIdentifier());
} else {
request.getResourceRef().setBaseRef(request.getHostRef());
}
if (request.isLoggable() && getLogger().isLoggable(Level.FINE)) {
getLogger().fine(
"Base URI: \"" + request.getResourceRef().getBaseRef()
+ "\". Remaining part: \""
+ request.getResourceRef().getRemainingPart()
+ "\"");
}
return CONTINUE;
}
代码示例来源:origin: com.noelios.restlet/com.noelios.restlet.ext.servlet
httpRequest.getResourceRef().setBaseRef(getBaseRef(request));
代码示例来源:origin: org.restlet/org.restlet.ext.servlet
httpRequest.getResourceRef().setBaseRef(getBaseRef(request));
代码示例来源:origin: org.restlet/org.restlet.ext.servlet
httpRequest.getResourceRef().setBaseRef(getBaseRef(request));
代码示例来源:origin: org.restlet.osgi/org.restlet
request.getResourceRef().setBaseRef(
request.getResourceRef().getHostIdentifier());
request.getResourceRef().setBaseRef(
request.getResourceRef().getHostIdentifier());
代码示例来源:origin: org.restlet.osgi/org.restlet
request.getResourceRef().setBaseRef(baseRef);
代码示例来源:origin: org.restlet/org.restlet
request.getResourceRef().setBaseRef(baseRef);
代码示例来源:origin: org.restlet.jee/org.restlet.ext.atom
/**
* Returns the feed representation.
*
* @return The feed representation.
* @throws Exception
*/
public Feed getFeed() throws Exception {
final Reference feedRef = getHref();
if (feedRef.isRelative()) {
feedRef.setBaseRef(getWorkspace().getService().getReference());
}
final Request request = new Request(Method.GET, feedRef.getTargetRef());
final Response response = getWorkspace().getService()
.getClientDispatcher().handle(request);
if (response.getStatus().equals(Status.SUCCESS_OK)) {
return new Feed(response.getEntity());
}
throw new Exception(
"Couldn't get the feed representation. Status returned: "
+ response.getStatus());
}
代码示例来源:origin: org.restlet.android/org.restlet.ext.atom
/**
* Returns the feed representation.
*
* @return The feed representation.
* @throws Exception
*/
public Feed getFeed() throws Exception {
final Reference feedRef = getHref();
if (feedRef.isRelative()) {
feedRef.setBaseRef(getWorkspace().getService().getReference());
}
final Request request = new Request(Method.GET, feedRef.getTargetRef());
final Response response = getWorkspace().getService()
.getClientDispatcher().handle(request);
if (response.getStatus().equals(Status.SUCCESS_OK)) {
return new Feed(response.getEntity());
}
throw new Exception(
"Couldn't get the feed representation. Status returned: "
+ response.getStatus());
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.wadl
rr.setBaseRef(rr.getBaseRef() + "/");
代码示例来源:origin: org.restlet/org.restlet.ext.atom
/**
* Returns the feed representation.
*
* @return The feed representation.
* @throws Exception
*/
public Feed getFeed() throws Exception {
final Reference feedRef = getHref();
if (feedRef.isRelative()) {
feedRef.setBaseRef(getWorkspace().getService().getReference());
}
final Request request = new Request(Method.GET, feedRef.getTargetRef());
final Response response = getWorkspace().getService()
.getClientDispatcher().handle(request);
if (response.getStatus().equals(Status.SUCCESS_OK)) {
return new Feed(response.getEntity());
} else {
throw new Exception(
"Couldn't get the feed representation. Status returned: "
+ response.getStatus().getDescription());
}
}
代码示例来源:origin: org.restlet.osgi/org.restlet
Application application = (Application) getChildContext()
.getChild();
request.getResourceRef().setBaseRef(
request.getResourceRef().getHostIdentifier());
application.getInboundRoot().handle(request, response);
代码示例来源:origin: org.restlet.osgi/org.restlet
Reference originalBaseRef = new Reference(this.originalRef);
originalBaseRef.setPath(getReference().getBaseRef().getPath());
this.originalRef.setBaseRef(originalBaseRef);
this.relativePart = this.originalRef.getRemainingPart(false, false);
内容来源于网络,如有侵权,请联系作者删除!