use of org.apache.jackrabbit.webdav.version.VersionControlledResource in project jackrabbit by apache.
the class CompareBaselineReport method getVersions.
private void getVersions(DavResource collection, List<VersionResource> vList) throws DavException {
DavResourceIterator it = collection.getMembers();
while (it.hasNext()) {
DavResource member = it.nextResource();
if (member instanceof VersionControlledResource) {
String href = new HrefProperty(member.getProperty(VersionControlledResource.CHECKED_IN)).getHrefs().get(0);
DavResourceLocator locator = member.getLocator();
DavResourceLocator vLocator = locator.getFactory().createResourceLocator(locator.getPrefix(), href);
DavResource v = member.getFactory().createResource(vLocator, member.getSession());
if (v instanceof VersionResource) {
vList.add((VersionResource) v);
} else {
log.error("Internal error: DAV:checked-in property must point to a VersionResource.");
}
}
if (member.isCollection()) {
getVersions(member, vList);
}
}
}
use of org.apache.jackrabbit.webdav.version.VersionControlledResource in project jackrabbit by apache.
the class AbstractWebdavServlet method doUpdate.
/**
* The UPDATE method
*
* @param request
* @param response
* @param resource
* @throws DavException
* @throws IOException
*/
protected void doUpdate(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException {
if (!(resource instanceof VersionControlledResource)) {
response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
return;
}
UpdateInfo info = request.getUpdateInfo();
MultiStatus ms = ((VersionControlledResource) resource).update(info);
response.sendMultiStatus(ms);
}
use of org.apache.jackrabbit.webdav.version.VersionControlledResource in project jackrabbit by apache.
the class AbstractWebdavServlet method doMerge.
/**
* The MERGE method
*
* @param request
* @param response
* @param resource
* @throws DavException
* @throws IOException
*/
protected void doMerge(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException {
if (!(resource instanceof VersionControlledResource)) {
response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
return;
}
MergeInfo info = request.getMergeInfo();
MultiStatus ms = ((VersionControlledResource) resource).merge(info);
response.sendMultiStatus(ms);
}
Aggregations