<BUG>String pageUri =UriBuilder.fromUri(baseUri).path(PageResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG><CONTEXT>Calendar calendar = Calendar.getInstance();calendar.setTime(xwikiAttachment.getDate());attachment.setDate(calendar);attachment.setXwikiRelativeUrl(xwikiRelativeUrl);attachment.setXwikiAbsoluteUrl(xwikiAbsoluteUrl);<extra_id_0>Link pageLink = objectFactory.createLink();</CONTEXT>
String pageUri = uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());