pnever      2005/02/25 07:32:16

  Modified:    src/share/org/apache/slide/lock Tag:
                        SLIDE_2_0_RELEASE_BRANCH LockImpl.java
               src/share/org/apache/slide/macro Tag:
                        SLIDE_2_0_RELEASE_BRANCH MacroImpl.java
               src/webdav/server/org/apache/slide/webdav/method Tag:
                        SLIDE_2_0_RELEASE_BRANCH RebindMethod.java
               src/share/org/apache/slide/structure Tag:
                        SLIDE_2_0_RELEASE_BRANCH StructureImpl.java
               src/webdav/server/org/apache/slide/webdav/util Tag:
                        SLIDE_2_0_RELEASE_BRANCH WebdavUtils.java
  Log:
  Removed some unnecessary forceStoreEnlistments
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.39.2.3  +11 -10    
jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java
  
  Index: LockImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v
  retrieving revision 1.39.2.2
  retrieving revision 1.39.2.3
  diff -u -r1.39.2.2 -r1.39.2.3
  --- LockImpl.java     5 Feb 2004 16:05:08 -0000       1.39.2.2
  +++ LockImpl.java     25 Feb 2005 15:32:14 -0000      1.39.2.3
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 The Apache Software Foundation
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -94,15 +94,15 @@
           
       /**
        * Put a lock on a subject.
  -     * 
  +     *
        * @param slideToken The token to access slide.
        * @param lockToken Object containing all the lock information
        * @exception ServiceAccessException Low level service access exception
  -     * @exception ObjectNotFoundException One of the objects referenced 
  +     * @exception ObjectNotFoundException One of the objects referenced
        * in the lock token were not found
  -     * @exception ObjectIsAlreadyLockedException Object is already locked 
  +     * @exception ObjectIsAlreadyLockedException Object is already locked
        * with an incompatible lock token
  -     * @exception AccessDeniedException Insufficient credentials to allow 
  +     * @exception AccessDeniedException Insufficient credentials to allow
        * object locking
        */
       public void lock(SlideToken slideToken, NodeLock lockToken)
  @@ -480,7 +480,8 @@
                               boolean tryToLock)
           throws ServiceAccessException, ObjectNotFoundException {
           
  -        return isLockedInternal(slideToken, token, tryToLock, null);
  +        SlideTokenWrapper readOnlyToken = new SlideTokenWrapper(slideToken, 
false);
  +        return isLockedInternal(readOnlyToken, token, tryToLock, null);
           
       }
       
  
  
  
  No                   revision
  No                   revision
  1.36.2.2  +17 -14    
jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java
  
  Index: MacroImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
  retrieving revision 1.36.2.1
  retrieving revision 1.36.2.2
  diff -u -r1.36.2.1 -r1.36.2.2
  --- MacroImpl.java    5 Feb 2004 16:05:08 -0000       1.36.2.1
  +++ MacroImpl.java    25 Feb 2005 15:32:14 -0000      1.36.2.2
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 The Apache Software Foundation
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -756,14 +756,14 @@
                       }
                   }
   
  -                             // Removing links objects
  -                             if (currentObject.hasLinks()) {
  -                                     Enumeration links = 
currentObject.enumerateLinks();
  -                                     while (links.hasMoreElements()) {
  -                                             String linkUri = 
(String)links.nextElement();
  -                                             deleteObject(token, linkUri, e, 
deleteRedirector, deleteListener);
  -                                     }
  -                             }
  +                // Removing links objects
  +                if (currentObject.hasLinks()) {
  +                    Enumeration links = currentObject.enumerateLinks();
  +                    while (links.hasMoreElements()) {
  +                        String linkUri = (String)links.nextElement();
  +                        deleteObject(token, linkUri, e, deleteRedirector, 
deleteListener);
  +                    }
  +                }
                   
                   
                   // now let the client redirect
  @@ -779,7 +779,7 @@
                   
                   NodeRevisionDescriptors revisionDescriptors =
                       contentHelper.retrieve(token, currentObject.getUri());
  -               
  +                
                   // remove the associated locks
                   Enumeration locks = lockHelper.enumerateLocks
                       (token, currentObject.getUri(), false);
  @@ -966,6 +966,8 @@
       private boolean isLockNull( SlideToken slideToken, String uriStr ) 
throws ServiceAccessException {
           boolean isLockNull = false;
           try {
  +            SlideTokenWrapper readOnlyToken = new 
SlideTokenWrapper(slideToken, false);
  +            slideToken = readOnlyToken;
               NodeRevisionDescriptor nrd =
                   contentHelper.retrieve(slideToken, 
contentHelper.retrieve(slideToken, uriStr));
               isLockNull = isLockNull( nrd );
  @@ -986,3 +988,4 @@
   
   
   
  +
  
  
  
  No                   revision
  No                   revision
  1.9.2.2   +21 -21    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java
  
  Index: RebindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- RebindMethod.java 5 Feb 2004 16:11:23 -0000       1.9.2.1
  +++ RebindMethod.java 25 Feb 2005 15:32:15 -0000      1.9.2.2
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 The Apache Software Foundation
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -58,8 +58,8 @@
       private ObjectNode sourceNode = null;
       private ObjectNode sourceParentNode = null;
       private ObjectNode collectionNode = null;
  -
  -
  +    
  +    
       /**
        * Constructor.
        *
  @@ -69,7 +69,7 @@
       public RebindMethod(NamespaceAccessToken token, WebdavServletConfig 
config) {
           super(token, config);
       }
  -
  +    
       /**
        * Parse WebDAV XML query.
        *
  @@ -80,10 +80,10 @@
           if (collectionUri == null) {
               collectionUri = "/";
           }
  -
  +        
           List content;
  -
  -//        readRequestContent();
  +        
  +        //        readRequestContent();
           try{
               content = parseRequestContent(E_REBIND).getChildren();
               segment = MethodUtil.getChildText(content, E_SEGMENT);
  @@ -99,15 +99,15 @@
               sendError( statusCode, e );
               throw new WebdavException( statusCode );
           }
  -
  +        
           collectionUri = requestUri;
           if (collectionUri == null) {
               collectionUri = "/";
           }
  -
  +        
           overwrite = requestHeaders.getOverwrite(true);
       }
  -
  +    
       private void checkPreconditions() throws PreconditionViolationException, 
ServiceAccessException {
           // use a non-blocking slide token.
           SlideToken stoken = readonlySlideToken();
  @@ -119,7 +119,7 @@
           if (sourceParentUh != null) {
               sourceParentUri = sourceUh.getParentUriHandler().toString();
           }
  -
  +        
           try {
               collectionNode = structure.retrieve( stoken, collectionUri );
           }
  @@ -127,7 +127,7 @@
               throw e;
           }
           catch (SlideException e) {} // ignore silently
  -
  +        
           try {
               sourceNode = structure.retrieve( stoken, sourceUri );
           }
  @@ -135,7 +135,7 @@
               throw e;
           }
           catch (SlideException e) {} // ignore silently
  -
  +        
           try {
               sourceParentNode = structure.retrieve( stoken, sourceParentUri );
           }
  @@ -143,7 +143,7 @@
               throw e;
           }
           catch (SlideException e) {} // ignore silently
  -
  +        
           if (collectionNode == null || !isCollection(collectionUri)) {
               throw new PreconditionViolationException(
                   new ViolatedPrecondition(C_REBIND_INTO_COLLECTION, 
WebdavStatus.SC_CONFLICT), collectionUri);
  @@ -172,17 +172,17 @@
               }
           }
       }
  -
  +    
       /**
        * Execute the request.
        *
        * @exception WebdavException
        */
       protected void executeRequest() throws WebdavException, IOException {
  -
  +        
           // Prevent dirty reads
           slideToken.setForceStoreEnlistment(true);
  -
  +        
           // check lock-null resources
           try {
               if (isLockNull(collectionUri)) {
  @@ -242,6 +242,6 @@
               throw new WebdavException( statusCode );
           }
       }
  -
  +    
   }
   
  
  
  
  No                   revision
  No                   revision
  1.39.2.3  +17 -10    
jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java
  
  Index: StructureImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/structure/StructureImpl.java,v
  retrieving revision 1.39.2.2
  retrieving revision 1.39.2.3
  diff -u -r1.39.2.2 -r1.39.2.3
  --- StructureImpl.java        24 Feb 2005 11:41:59 -0000      1.39.2.2
  +++ StructureImpl.java        25 Feb 2005 15:32:15 -0000      1.39.2.3
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 The Apache Software Foundation
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -176,8 +176,8 @@
               
               String resolvedUri = uri.toString();
               
  -             SlideToken originalToken = token;
  -             token = new SlideTokenWrapper(token, false);  // do the 
traversing in read mode
  +            SlideToken originalToken = token;
  +            token = new SlideTokenWrapper(token, false);  // do the 
traversing in read mode
               
               // 1 - Tokemization of the Uri
               UriTokenizer uriTokenizer = new UriTokenizer(token, 
uri.getNamespace(),
  @@ -258,9 +258,9 @@
           ObjectNotFoundException, LinkedObjectNotFoundException,
           AccessDeniedException, ObjectLockedException {
           
  -     SlideToken originalToken = token;
  -     token = new SlideTokenWrapper(token, false);  // do the traversing in 
read mode
  -             
  +        SlideToken originalToken = token;
  +        token = new SlideTokenWrapper(token, false);  // do the traversing 
in read mode
  +        
           // Checking roles
           Enumeration roles = securityHelper.getRoles(object);
           while (roles.hasMoreElements()) {
  @@ -433,6 +433,9 @@
           throws ServiceAccessException, ObjectNotFoundException,
           AccessDeniedException, LinkedObjectNotFoundException {
           
  +        SlideToken originalToken = token;
  +        token = new SlideTokenWrapper(token, false);  // do the traversing 
in read mode
  +        
           // Checking roles
           Enumeration roles = securityHelper.getRoles(object);
           while (roles.hasMoreElements()) {
  @@ -468,6 +471,9 @@
               catch (RevisionDescriptorNotFoundException e) {
                   // ignore silently
               }
  +            catch (Exception e) {
  +                e.printStackTrace();
  +            }
           }
       }
       
  @@ -666,3 +672,4 @@
   }
   
   
  +
  
  
  
  No                   revision
  No                   revision
  1.13.2.3  +8 -5      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java
  
  Index: WebdavUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/WebdavUtils.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- WebdavUtils.java  14 Mar 2004 18:14:56 -0000      1.13.2.2
  +++ WebdavUtils.java  25 Feb 2005 15:32:16 -0000      1.13.2.3
  @@ -5,7 +5,7 @@
    *
    * ====================================================================
    *
  - * Copyright 1999-2002 The Apache Software Foundation 
  + * Copyright 1999-2002 The Apache Software Foundation
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
  @@ -418,6 +418,9 @@
       public static boolean isCollection
           (NamespaceAccessToken token, SlideToken slideToken,
            String path) {
  +
  +        SlideTokenWrapper readOnlyToken = new SlideTokenWrapper(slideToken, 
false);
  +        slideToken = readOnlyToken;
           
           if (slideToken.isForceStoreEnlistment()) {
               slideToken = new SlideTokenWrapper(slideToken, false); // check 
only, no enlistment
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to