use of org.apache.jackrabbit.webdav.jcr.version.VersionHistoryItemCollection in project jackrabbit by apache.
the class DavResourceFactoryImpl method createResourceForItem.
/**
* Tries to retrieve the repository item defined by the locator's resource
* path and build the corresponding WebDAV resource. The following distinction
* is made between items: Version nodes, VersionHistory nodes, root node,
* unspecified nodes and finally property items.
*
* @param locator
* @param sessionImpl
* @return DavResource representing a repository item.
* @throws RepositoryException if {@link javax.jcr.Session#getItem(String)} fails.
*/
private DavResource createResourceForItem(DavResourceLocator locator, JcrDavSession sessionImpl) throws RepositoryException, DavException {
DavResource resource;
Item item = getItem(sessionImpl, locator);
if (item.isNode()) {
// create special resources for Version and VersionHistory
if (item instanceof Version) {
resource = new VersionItemCollection(locator, sessionImpl, this, item);
} else if (item instanceof VersionHistory) {
resource = new VersionHistoryItemCollection(locator, sessionImpl, this, item);
} else {
resource = new VersionControlledItemCollection(locator, sessionImpl, this, item);
}
} else {
resource = new DefaultItemResource(locator, sessionImpl, this, item);
}
return resource;
}
Aggregations