drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java
public LockToken lock(boolean isShared, String depth, int timeout, String owner) throws DAVException {

        // Define the request context.
        IContext context = newContext();
        context.setDepth(depth);
        context.setTimeout(timeout);

        // Create the request body.
        Document document = newDocument();
        LockInfo lockinfo = LockInfo.create(document);
        lockinfo.setIsShared(isShared);

        // Add the owner if it is given.
        if (owner != null) {
            Owner ownerEditor = lockinfo.setOwner();
            ownerEditor.getElement().appendChild(document.createTextNode(owner));
        }

        // Send the lock request.
        IResponse response = null;
        try {
            response = davClient.lock(locator, context, document);
            examineResponse(response);
        } catch (IOException e) {
            throw new SystemException(e);
        } finally {
            closeResponse(response);
        }

        // Extract the token from the resulting context.
        LockToken token = new LockToken(response.getContext().getLockToken());
        //fServerManager.addLock(newURL(fLocator.getResourceURL()), token, depth);
        return token;
    }
public LockToken lock(boolean isShared, String depth, int timeout, String owner) throws DAVException {

        // Define the request context.
        IContext context = newContext();
        context.setDepth(depth);
        context.setTimeout(timeout);

        // Create the request body.
        Document document = newDocument();
        LockInfo lockinfo = LockInfo.create(document);
        lockinfo.setIsShared(isShared);

        // Add the owner if it is given.
        if (owner != null) {
            Owner ownerEditor = lockinfo.setOwner();
            ownerEditor.getElement().appendChild(document.createTextNode(owner));
        }

        // Send the lock request.
        IResponse response = null;
        try {
            response = davClient.lock(locator, context, document);
            examineResponse(response);
        } catch (IOException e) {
            throw new SystemException(e);
        } finally {
            closeResponse(response);
        }

        // Extract the token from the resulting context.
        LockToken token = new LockToken(response.getContext().getLockToken());
        //fServerManager.addLock(newURL(fLocator.getResourceURL()), token, depth);
        return token;
    }
Lock this resource using the specified parameters.

@param isShared true if the lock is shared, false if the lock is exclusive
@param depth eg. <code>Context.DEPTH_ZERO</code>
@param timeout the timeout value for the lock
@param owner the owner of the lock
@return the lock token
@exception DAVException if there was a problem locking this resource
@see IServer#lock(Locator, Context, Document)