@LOCK
   @Path("/{repoName}/{repoPath:.*}/")
   public Response lock(@PathParam("repoName") String repoName, @PathParam("repoPath") String repoPath,
      @HeaderParam(ExtHttpHeaders.LOCKTOKEN) String lockTokenHeader, @HeaderParam(ExtHttpHeaders.IF) String ifHeader,
      @HeaderParam(ExtHttpHeaders.DEPTH) String depthHeader, HierarchicalProperty body)
   {

      if (log.isDebugEnabled())
      {
         log.debug("LOCK " + repoName + "/" + repoPath);
      }

      repoPath = normalizePath(repoPath);

      try
      {
         Session session = session(repoName, workspaceName(repoPath), lockTokens(lockTokenHeader, ifHeader));
         return new LockCommand(nullResourceLocks).lock(session, path(repoPath), body, new Depth(depthHeader), "86400");

      }
      catch (PreconditionException exc)
      {
         log.error("PreconditionException " + exc.getMessage(), exc);
         return Response.status(HTTPStatus.PRECON_FAILED).entity(exc.getMessage()).build();

      }
      catch (NoSuchWorkspaceException exc)
      {
         log.error("NoSuchWorkspaceException " + exc.getMessage(), exc);
         return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage()).build();

      }
      catch (Exception exc)
      {
         log.error(exc.getMessage(), exc);
         return Response.serverError().entity(exc.getMessage()).build();
      }
   }
@ LOCK @ Path ( "/{repoName}/{repoPath:.*}/" ) public Response lock ( @ PathParam ( "repoName" ) String repoName , @ PathParam ( "repoPath" ) String repoPath , @ HeaderParam ( ExtHttpHeaders . LOCKTOKEN ) String lockTokenHeader , @ HeaderParam ( ExtHttpHeaders . IF ) String ifHeader , @ HeaderParam ( ExtHttpHeaders . DEPTH ) String depthHeader , HierarchicalProperty body ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "LOCK " + repoName + "/" + repoPath ) ; } repoPath = normalizePath ( repoPath ) ; try { Session session = session ( repoName , workspaceName ( repoPath ) , lockTokens ( lockTokenHeader , ifHeader ) ) ; return new LockCommand ( nullResourceLocks ) . lock ( session , path ( repoPath ) , body , new Depth ( depthHeader ) , "86400" ) ; } catch ( PreconditionException exc ) { log . error ( "PreconditionException " + exc . getMessage ( ) , exc ) ; return Response . status ( HTTPStatus . PRECON_FAILED ) . entity ( exc . getMessage ( ) ) . build ( ) ; } catch ( NoSuchWorkspaceException exc ) { log . error ( "NoSuchWorkspaceException " + exc . getMessage ( ) , exc ) ; return Response . status ( HTTPStatus . CONFLICT ) . entity ( exc . getMessage ( ) ) . build ( ) ; } catch ( Exception exc ) { log . error ( exc . getMessage ( ) , exc ) ; return Response . serverError ( ) . entity ( exc . getMessage ( ) ) . build ( ) ; } }
@param repoName repository name
@param repoPath path in repository
@param lockTokenHeader Lock-Token HTTP header
@param ifHeader If- HTTP Header
@param depthHeader Depth HTTP header
@param body Request body
@return the instance of javax.ws.rs.core.Response
@LevelAPI Platform