code: public Response versionControl(Session session, String path)
     {
        try
        {
           Node node = (Node)session.getItem(path);
  
           if (!node.isNodeType("mix:versionable"))
           {
              node.addMixin("mix:versionable");
              session.save();
           }
           return Response.ok().build();
  
        }
        catch (LockException exc)
        {
           return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()).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 Version-Control method implementation.
  
  @param session current session
  @param path resource path
  @return the instance of javax.ws.rs.core.Response