code: public Response head(Session session, String path, String baseURI)
     {
        try
        {
           Node node = (Node)session.getItem(path);
  
           WebDavNamespaceContext nsContext = new WebDavNamespaceContext(session);
           URI uri = new URI(TextUtil.escape(baseURI + node.getPath(), '%', true));
  
           if (ResourceUtil.isFile(node))
           {
              Resource resource = new FileResource(uri, node, nsContext);
  
              String lastModified = resource.getProperty(PropertyConstants.GETLASTMODIFIED).getValue();
              String contentType = resource.getProperty(PropertyConstants.GETCONTENTTYPE).getValue();
              String contentLength = resource.getProperty(PropertyConstants.GETCONTENTLENGTH).getValue();
  
              return Response.ok().header(ExtHttpHeaders.LAST_MODIFIED, lastModified).header(ExtHttpHeaders.CONTENT_TYPE,
                 contentType).header(ExtHttpHeaders.CONTENT_LENGTH, contentLength).build();
           }
  
           return Response.ok().build();
        }
        catch (PathNotFoundException exc)
        {
           return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessage()).build();
        }
        catch (Exception exc)
        {
           LOG.error(exc.getMessage(), exc);
           return Response.serverError().entity(exc.getMessage()).build();
        }
     }
docs: Webdav Head method implementation.
  
  @param session current session
  @param path resouce path
  @param baseURI base uri
  @return the instance of javax.ws.rs.core.Response