return;
}
// Check if operation allowed by OLAT VFS security callback
DirContext resources = getResources(req);
VFSDirContext vfsContext = (VFSDirContext) resources;
String path = getRelativePath(req);
if (!vfsContext.canWrite(path)) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
if (isLocked(req)) {
resp.sendError(WebdavStatus.SC_LOCKED);
return;
}
path = getRelativePath(req);
if ((path.toUpperCase().startsWith("/WEB-INF")) ||
(path.toUpperCase().startsWith("/META-INF"))) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
// Retrieve the resources
resources = getResources(req);
if (resources == null) {
resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
// Check if operation allowed by OLAT VFS security callback
vfsContext = (VFSDirContext) resources;
if (!vfsContext.canWrite(path)) {
resp.sendError(WebdavStatus.SC_FORBIDDEN);
return;
}
boolean exists = true;