* @throws WebApplicationException if neither the 'edit' nor the 'self'
* links exist.
*/
private String getResourceLink(SyndBase synd) {
// try 'edit' link
SyndLink link = synd.getLink("edit"); //$NON-NLS-1$
if (link == null) {
// try 'self' link
link = synd.getLink("self"); //$NON-NLS-1$
}
if (link == null) {
// no link in the resource
if (logger.isErrorEnabled()) {
logger.error(Messages.getMessage("webDAVNoEditOrSelfLink", synd.getId())); //$NON-NLS-1$
}
throw new WebApplicationException();
}
URI uri = URI.create(link.getHref()).normalize();
if (!uri.isAbsolute()) {
// add base URI for relative links
URI base = uriInfo.getAbsolutePath();
if (synd.getBase() != null) {
base = URI.create(synd.getBase());