本文整理了Java中org.restlet.data.Reference.toUri
方法的一些代码示例,展示了Reference.toUri
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.toUri
方法的具体详情如下:
包路径:org.restlet.data.Reference
类名称:Reference
方法名:toUri
[英]Converts to a java.net.URI instance. Note that relative references are resolved before conversion using the #getTargetRef() method.
[中]转换为java。网URI实例。请注意,在转换之前,使用#getTargetRef()方法解析相对引用。
代码示例来源:origin: apache/attic-polygene-java
@Override
public RestLink createRestLink( String name, Reference base, Method method )
{
ValueBuilder<RestLink> builder = vbf.newValueBuilder( RestLink.class );
RestLink prototype = builder.prototype();
String path = base.toUri().resolve( name ).getPath();
prototype.path().set( path.endsWith( "/" ) ? path : path + "/" );
prototype.method().set( method.getName() );
return builder.newInstance();
}
代码示例来源:origin: apache/attic-polygene-java
HandlerCommand command( Link link, Object commandRequest, ResponseHandler handler, ResponseHandler processingErrorHandler )
{
if (handler == null)
handler = commandHandlers.get( link.rel().get() );
if (processingErrorHandler == null)
processingErrorHandler = processingErrorHandlers.get( link.rel().get() );
// Check if we should do POST or PUT
Method method;
if( LinksUtil.withClass( "idempotent" ).test( link ) )
{
method = Method.PUT;
}
else
{
method = Method.POST;
}
Reference ref = new Reference( reference.toUri().toString() + link.href().get() );
return invokeCommand( ref, method, commandRequest, handler, processingErrorHandler );
}
代码示例来源:origin: org.restlet.jee/org.restlet.ext.jaxrs
/**
* Creates a RESTEasy URI info object.
*
* @return A RESTEasy URI info object.
*/
protected ResteasyUriInfo createUriInfo() {
try {
return new ResteasyUriInfo(getRequest().getResourceRef()
.getBaseRef().toUri(), new URI(getRequest()
.getResourceRef().getRelativeRef().toString()));
} catch (URISyntaxException e) {
Context.getCurrentLogger().log(Level.WARNING,
"Unable to parse the URI.", e);
return null;
}
}
代码示例来源:origin: apache/attic-polygene-java
HandlerCommand query( Link link, Object queryRequest, ResponseHandler handler, ResponseHandler processingErrorHandler )
{
if (handler == null)
handler = queryHandlers.get( link.rel().get() );
if (handler == null)
throw new IllegalArgumentException( "No handler set for relation "+link.rel().get() );
if (processingErrorHandler == null)
processingErrorHandler = processingErrorHandlers.get( link.rel().get() );
Reference linkRef = new Reference(link.href().get());
if (linkRef.isRelative())
linkRef = new Reference( reference.toUri().toString() + link.href().get() );
return invokeQuery( linkRef, queryRequest, handler, processingErrorHandler );
}
代码示例来源:origin: apache/attic-polygene-java
@Override
public RestLink createRestLink( String name, Reference base, Method method, String description )
{
ValueBuilder<RestLink> builder = vbf.newValueBuilder( RestLink.class );
RestLink prototype = builder.prototype();
prototype.path().set( base.toUri().resolve( name ).getPath() + "/" );
prototype.method().set( method.getName() );
prototype.description().set( description );
return builder.newInstance();
}
代码示例来源:origin: org.restlet.osgi/org.restlet.ext.oauth
getLogger().fine("Redirecting to : " + redirRef.toUri());
response.setCacheDirectives(no);
response.redirectTemporary(redirRef);
getLogger().fine("After Redirecting to : " + redirRef.toUri());
return STOP;
代码示例来源:origin: apache/attic-polygene-java
responseHandler = deleteHandler;
Request request = new Request( Method.DELETE, new Reference( reference.toUri() ).toString() );
contextResourceFactory.updateCommandRequest( request );
内容来源于网络,如有侵权,请联系作者删除!