You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/04/03 13:55:07 UTC

cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method PropPatchMethod.java PutMethod.java ReportMethod.java

juergen     02/04/03 03:55:07

  Modified:    src/webdav/server/org/apache/slide/webdav/util
                        PreconditionViolationException.java
               src/webdav/server/org/apache/slide/webdav/method
                        PropPatchMethod.java PutMethod.java
                        ReportMethod.java
  Log:
  PreconditionViolationException now also provides the URI of the resource that caused it.
  (ralf)
  
  Revision  Changes    Path
  1.3       +24 -5     jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PreconditionViolationException.java
  
  Index: PreconditionViolationException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PreconditionViolationException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PreconditionViolationException.java	28 Mar 2002 06:12:13 -0000	1.2
  +++ PreconditionViolationException.java	3 Apr 2002 11:55:06 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PreconditionViolationException.java,v 1.2 2002/03/28 06:12:13 jericho Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/28 06:12:13 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PreconditionViolationException.java,v 1.3 2002/04/03 11:55:06 juergen Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/03 11:55:06 $
    *
    * ====================================================================
    *
  @@ -68,7 +68,7 @@
   /**
    * This exception is thrown due to a violated precondition.
    *
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    *
    * @author <a href="mailto:ralf.stuckert@softwareag.com">Ralf Stuckert</a>
    **/
  @@ -80,13 +80,23 @@
       protected ViolatedPrecondition violatedPrecondition = null;
       
       /**
  +     * The URI of the resource associated with the precondition violation.
  +     */
  +    protected String objectUri = null;
  +    
  +    
  +    /**
        * Creates a PreconditionViolationException.
        *
        * @param      violatedPrecondition  the precondition that has been violated.
  +     * @param      objectUri             the URI of the resource associated with
  +     *                                   the precondition violation.
        */
  -    public PreconditionViolationException(ViolatedPrecondition violatedPrecondition) {
  +    public PreconditionViolationException(ViolatedPrecondition violatedPrecondition,
  +                                         String objectUri) {
           super(violatedPrecondition.getStatusCode());
           this.violatedPrecondition = violatedPrecondition;
  +        this.objectUri = objectUri;
       }
       
       /**
  @@ -96,6 +106,15 @@
        */
       public ViolatedPrecondition getViolatedPrecondition() {
           return violatedPrecondition;
  +    }
  +    
  +    /**
  +     * Returns the URI of the resource associated with the precondition violation.
  +     *
  +     * @return    the URI of the resource associated with the precondition violation.
  +     */
  +    public String getObjectUri() {
  +        return objectUri;
       }
       
   }
  
  
  
  1.32      +4 -4      jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
  
  Index: PropPatchMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- PropPatchMethod.java	28 Mar 2002 06:12:12 -0000	1.31
  +++ PropPatchMethod.java	3 Apr 2002 11:55:07 -0000	1.32
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v 1.31 2002/03/28 06:12:12 jericho Exp $
  - * $Revision: 1.31 $
  - * $Date: 2002/03/28 06:12:12 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v 1.32 2002/04/03 11:55:07 juergen Exp $
  + * $Revision: 1.32 $
  + * $Date: 2002/04/03 11:55:07 $
    *
    * ====================================================================
    *
  @@ -315,7 +315,7 @@
               // TODO: check DAV:cannot-modify-protected-property
               // TODO: check DAV:supported-live-property-set
               if (violatedPrecondition != null) {
  -                throw new PreconditionViolationException(violatedPrecondition);
  +                throw new PreconditionViolationException(violatedPrecondition, resourcePath);
               }
               
               // Changed for DeltaV --start--
  
  
  
  1.36      +4 -4      jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
  
  Index: PutMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- PutMethod.java	28 Mar 2002 06:12:12 -0000	1.35
  +++ PutMethod.java	3 Apr 2002 11:55:07 -0000	1.36
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v 1.35 2002/03/28 06:12:12 jericho Exp $
  - * $Revision: 1.35 $
  - * $Date: 2002/03/28 06:12:12 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v 1.36 2002/04/03 11:55:07 juergen Exp $
  + * $Revision: 1.36 $
  + * $Date: 2002/04/03 11:55:07 $
    *
    * ====================================================================
    *
  @@ -218,7 +218,7 @@
                   // check preconditions
                   ViolatedPrecondition violatedPrecondition = getPreconditionViolation(revisionDescriptor);
                   if (violatedPrecondition != null) {
  -                    throw new PreconditionViolationException(violatedPrecondition);
  +                    throw new PreconditionViolationException(violatedPrecondition, resourcePath);
                   }
                   
                   // Changed for DeltaV --start--
  
  
  
  1.12      +5 -5      jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
  
  Index: ReportMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ReportMethod.java	28 Mar 2002 06:12:12 -0000	1.11
  +++ ReportMethod.java	3 Apr 2002 11:55:07 -0000	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v 1.11 2002/03/28 06:12:12 jericho Exp $
  - * $Revision: 1.11 $
  - * $Date: 2002/03/28 06:12:12 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v 1.12 2002/04/03 11:55:07 juergen Exp $
  + * $Revision: 1.12 $
  + * $Date: 2002/04/03 11:55:07 $
    *
    * ====================================================================
    *
  @@ -153,7 +153,7 @@
   /**
    * An implementation of the DeltaV <code>REPORT</code> method.
    *
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    *
    * @author <a href="mailto:ralf.stuckert@softwareag.com">Ralf Stuckert</a>
    */
  @@ -953,7 +953,7 @@
                   isVersionHistory = uriHandler.isHistoryUri();
               }
               if ( ! isVersionHistory ) {
  -                throw new PreconditionViolationException(new ViolatedPrecondition(C_MUST_BE_VERSION_HISTORY, WebdavStatus.SC_CONFLICT));
  +                throw new PreconditionViolationException(new ViolatedPrecondition(C_MUST_BE_VERSION_HISTORY, WebdavStatus.SC_CONFLICT), requestUri);
               }
           }
           writeLocateByHistoryReport(requestUri, parentElement, depth);
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>