code: public Response report(Session session, String path, HierarchicalProperty body, Depth depth, String baseURI)
     {
        try
        {
           Node node = (Node)session.getItem(path);
           WebDavNamespaceContext nsContext = new WebDavNamespaceContext(session);
           String strUri = baseURI + node.getPath();
           URI uri = new URI(TextUtil.escape(strUri, '%', true));
  
           if (!ResourceUtil.isVersioned(node))
           {
              return Response.status(HTTPStatus.PRECON_FAILED).build();
           }
  
           VersionedResource resource;
           if (ResourceUtil.isFile(node))
           {
              resource = new VersionedFileResource(uri, node, nsContext);
           }
           else
           {
              resource = new VersionedCollectionResource(uri, node, nsContext);
           }
  
           Set<QName> properties = getProperties(body);
  
           VersionTreeResponseEntity response = new VersionTreeResponseEntity(nsContext, resource, properties);
  
           return Response.status(HTTPStatus.MULTISTATUS).entity(response).build();
  
        }
        catch (PathNotFoundException exc)
        {
           return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessage()).build();
        }
        catch (RepositoryException exc)
        {
           LOG.error(exc.getMessage(), exc);
           return Response.serverError().entity(exc.getMessage()).build();
        }
        catch (Exception exc)
        {
           LOG.error(exc.getMessage(), exc);
           return Response.serverError().entity(exc.getMessage()).build();
        }
     }
docs: Webdav Report method implementation.
  
  @param session current session
  @param path resource path
  @param body request bidy
  @param depth report depth
  @param baseURI base Uri
  @return the instance of javax.ws.rs.core.Response