本文整理匯總了Java中org.restlet.data.Reference.getTargetRef方法的典型用法代碼示例。如果您正苦於以下問題:Java Reference.getTargetRef方法的具體用法?Java Reference.getTargetRef怎麽用?Java Reference.getTargetRef使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.restlet.data.Reference
的用法示例。
在下文中一共展示了Reference.getTargetRef方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTargetRef
import org.restlet.data.Reference; //導入方法依賴的package包/類
@Override
protected Reference getTargetRef( Request request, Response response )
{
Reference reference = super.getTargetRef( request, response );
// Relative references should be considered relative to the resource
// reference
if( reference.getBaseRef() == null )
reference.setBaseRef( request.getResourceRef() );
return reference.getTargetRef();
}
示例2: createRootReference
import org.restlet.data.Reference; //導入方法依賴的package包/類
/**
* create absolute path reference
*
* @param request
* the request
* @param relPart
* the relative path
* @return Returns the reference representation of absolute path.
*/
public static Reference createRootReference(Request request, String relPart) {
Assert.notNull(relPart, "relPart is required");
Assert.notNull(request, "request is required");
Assert.notNull(request.getRootRef(), "root reference in request is required");
if (!relPart.isEmpty() && relPart.charAt(0) == '/') {
relPart = relPart.substring(1);
}
Reference ref = new Reference(new Reference(WebUtils.CleanupPath(request.getRootRef().toString())), relPart);
return ref.getTargetRef();
}