msmith      02/04/11 19:29:26

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        DeleteMethod.java
  Log:
  Prevent IllegalStateExceptions on deleting things when versioncontrol
  is disabled.
  
  Revision  Changes    Path
  1.17      +13 -11    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java
  
  Index: DeleteMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DeleteMethod.java 4 Apr 2002 11:42:18 -0000       1.16
  +++ DeleteMethod.java 12 Apr 2002 02:29:26 -0000      1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
 1.16 2002/04/04 11:42:18 juergen Exp $
  - * $Revision: 1.16 $
  - * $Date: 2002/04/04 11:42:18 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/DeleteMethod.java,v
 1.17 2002/04/12 02:29:26 msmith Exp $
  + * $Revision: 1.17 $
  + * $Date: 2002/04/12 02:29:26 $
    *
    * ====================================================================
    *
  @@ -85,6 +85,7 @@
   import org.apache.slide.webdav.util.XMLValue;
   import org.apache.slide.webdav.util.VersioningHelper;
   import org.apache.slide.webdav.util.PropertyHelper;
  +import org.apache.slide.util.Configuration;
   
   import org.jdom.Element;
   import org.jdom.JDOMException;
  @@ -248,16 +249,17 @@
        *                             MacroDeleteException.
        */
       public void beforeDelete(String targetUri) throws SlideException {
  +        if(Configuration.useVersionControl()) {
           
  -        uriHandler = UriHandler.getUriHandler(token, targetUri);
  -        if (uriHandler.isVersionUri() && !isCollection) {
  -            // delete of version is only allowed if the history collection is 
deleted
  -            throw new PreconditionViolationException(new 
ViolatedPrecondition(C_NO_VERSION_DELETE,
  -                                                                              
WebdavStatus.SC_FORBIDDEN),
  -                                                     targetUri);
  -        }
  +            uriHandler = UriHandler.getUriHandler(token, targetUri);
  +            if (uriHandler.isVersionUri() && !isCollection) {
  +                // delete of version is only allowed if the history collection is 
deleted
  +                throw new PreconditionViolationException(
  +                        new ViolatedPrecondition(C_NO_VERSION_DELETE, 
WebdavStatus.SC_FORBIDDEN), targetUri);
  +            }
           
  -        uriOfAssociatedVR = versioningHelper.getUriOfAssociatedVR(targetUri);
  +            uriOfAssociatedVR = versioningHelper.getUriOfAssociatedVR(targetUri);
  +        }
       }
       
       
  
  
  

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

Reply via email to