Package org.apache.webdav.lib.methods

Examples of org.apache.webdav.lib.methods.UnlockMethod


        // Discover the locktoken from the given lock owner
        state = discoverLock(owner, path, state);
        String lock = state.getLock(path);
        if (lock == null) return false;
        // unlock for the given path.
        UnlockMethod method = new UnlockMethod(URIUtil.encodePath(path));
        generateIfHeader(method);
        method.setLockToken(lock);
        int statusCode = client.executeMethod(method);

        setStatusCode(statusCode);
        if (statusCode >= 200 && statusCode < 300) {
            state.removeLocks(path);
View Full Code Here


  
   public static void unlockResource(HttpClient client, HttpURL url,
                                     String lockToken)
      throws IOException, HttpException
   {
      UnlockMethod unlock = new UnlockMethod(url.getURI(), lockToken);
      unlock.setFollowRedirects(true);
      int status = client.executeMethod(unlock);
     
      switch (status) {
         case WebdavStatus.SC_OK:
         case WebdavStatus.SC_NO_CONTENT:
            return;
        
         default:
            HttpException ex = new HttpException();
            ex.setReasonCode(status);
            ex.setReason(unlock.getStatusText());
            throw ex;
      }
   }
View Full Code Here

        // Discover the locktoken from the given lock owner
        state = discoverLock(owner, path, state);
        String lock = state.getLock(path);
        if (lock == null) return false;
        // unlock for the given path.
        UnlockMethod method = new UnlockMethod(URIUtil.encodePath(path));
        generateIfHeader(method);
        method.setLockToken(lock);
        int statusCode = client.executeMethod(method);

        setStatusCode(statusCode);
        if (statusCode >= 200 && statusCode < 300) {
            state.removeLocks(path);
View Full Code Here

TOP

Related Classes of org.apache.webdav.lib.methods.UnlockMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.