String newName = req.getParameter("newName");
IVResource source = user.getResource(oldName);
IVResource newResource = user.createResource(newName, source.isDirectory());
if (source.isDirectory()) {
newResource.mkdir();
VResourceUtils.copyDirectory(source, newResource, true);
} else {
VResourceUtils.copyFile(source, newResource);
}
source.delete();