juergen     02/03/15 02:07:38

  Modified:    src/webdav/server/org/apache/slide/webdav/util
                        VersioningHelper.java
  Log:
  Removed unneeded parameter in method getVersioningHelper().
  (ralf)
  
  Revision  Changes    Path
  1.9       +17 -29    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java
  
  Index: VersioningHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- VersioningHelper.java     15 Mar 2002 09:38:05 -0000      1.8
  +++ VersioningHelper.java     15 Mar 2002 10:07:38 -0000      1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
 1.8 2002/03/15 09:38:05 juergen Exp $
  - * $Revision: 1.8 $
  - * $Date: 2002/03/15 09:38:05 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
 1.9 2002/03/15 10:07:38 juergen Exp $
  + * $Revision: 1.9 $
  + * $Date: 2002/03/15 10:07:38 $
    *
    * ====================================================================
    *
  @@ -128,9 +128,9 @@
        */
       public static VersioningHelper
       getVersioningHelper( SlideToken sToken, NamespaceAccessToken nsaToken,
  -                            HttpServletRequest req, HttpServletResponse resp, 
Document requestContent, WebdavServletConfig sConf ) {
  +                            HttpServletRequest req, HttpServletResponse resp, 
WebdavServletConfig sConf ) {
                                
  -        return new VersioningHelper( sToken, nsaToken, req, resp, requestContent, 
sConf );
  +        return new VersioningHelper( sToken, nsaToken, req, resp, sConf );
       }
       
       /**
  @@ -144,17 +144,15 @@
       private HttpServletResponse resp = null;
       private WebdavServletConfig sConf = null;
       private PropertyHelper pHelp = null;
  -    private Document requestContent = null;
       
       /**
        * Protected contructor
        */
       protected VersioningHelper( SlideToken sToken, NamespaceAccessToken nsaToken,
  -                               HttpServletRequest req, HttpServletResponse resp, 
Document requestContent, WebdavServletConfig sConf ) {
  +                               HttpServletRequest req, HttpServletResponse resp, 
WebdavServletConfig sConf ) {
           super( sToken, nsaToken );
           this.req = req;
           this.resp = resp;
  -        this.requestContent = requestContent;
           this.sConf = sConf;
           this.content = nsaToken.getContentHelper();
           this.structure = nsaToken.getStructureHelper();
  @@ -350,7 +348,7 @@
               NodeRevisionDescriptors cinNrds = content.retrieve(sToken, cinUri);
               NodeRevisionDescriptor cinNrd = content.retrieve(sToken, cinNrds, 
cinNrn);
               
  -            ViolatedPrecondition violatedPrecondition = 
getCheckoutPreconditionViolation(cinNrd, cinNrds);
  +            ViolatedPrecondition violatedPrecondition = 
getCheckoutPreconditionViolation(cinNrd, cinNrds, forkOk);
               if (violatedPrecondition != null) {
                   sendPreconditionViolation(violatedPrecondition);
                   return;
  @@ -387,10 +385,12 @@
        *
        * @param      cinNrd   the NodeRevisionDescriptor of the VR to checkout.
        * @param      cinNrds  the NodeRevisionDescriptors of the VR to checkout.
  +     * @param      isForkOk      indicates if <code>&lt;fork-ok&gt;</code> is set in
  +     *                           the request content.
        *
        * @return     the ViolatedPrecondition (if any).
        */
  -    private ViolatedPrecondition 
getCheckoutPreconditionViolation(NodeRevisionDescriptor cinNrd, 
NodeRevisionDescriptors cinNrds) throws IllegalArgumentException, IOException, 
JDOMException {
  +    private ViolatedPrecondition 
getCheckoutPreconditionViolation(NodeRevisionDescriptor cinNrd, 
NodeRevisionDescriptors cinNrds, boolean isForkOk) throws IllegalArgumentException, 
IOException, JDOMException {
           
           ViolatedPrecondition violatedPrecondition = null;
           
  @@ -408,7 +408,7 @@
                       }
                       
                       // check precondition 
C_CHECKOUT_OF_VERSION_WITH_DESCENDANT_IS_DISCOURAGED
  -                    else if (E_DISCOURAGED.equals(checkoutForkElement.getName()) && 
!isForkOK())  {
  +                    else if (E_DISCOURAGED.equals(checkoutForkElement.getName()) && 
!isForkOk)  {
                           violatedPrecondition = new 
ViolatedPrecondition(C_CHECKOUT_OF_VERSION_WITH_DESCENDANT_IS_DISCOURAGED, 
WebdavStatus.SC_CONFLICT);
                       }
                   }
  @@ -425,7 +425,7 @@
                           }
                           
                           // check precondition 
C_CHECKOUT_OF_CHECKED_OUT_VERSION_IS_DISCOURAGED
  -                        else if 
(E_DISCOURAGED.equals(checkoutForkElement.getName()) && !isForkOK())  {
  +                        else if 
(E_DISCOURAGED.equals(checkoutForkElement.getName()) && !isForkOk)  {
                               violatedPrecondition = new 
ViolatedPrecondition(C_CHECKOUT_OF_CHECKED_OUT_VERSION_IS_DISCOURAGED, 
WebdavStatus.SC_CONFLICT);
                           }
                       }
  @@ -486,7 +486,7 @@
               NodeRevisionDescriptor vrNrdOld =
                   retrieveLatestRevisionDescriptor( vrUriOld, vhrNrds );
               
  -            ViolatedPrecondition violatedPrecondition = 
getCheckinPreconditionViolation(predSetProp, vhrNrds);
  +            ViolatedPrecondition violatedPrecondition = 
getCheckinPreconditionViolation(predSetProp, vhrNrds, forkOk);
               if (violatedPrecondition != null) {
                   sendPreconditionViolation(violatedPrecondition);
                   return;
  @@ -560,10 +560,12 @@
        * @param      predSetProp   the <code>predecessor-set</code> NodeProperty
        *                           of the VCR to checkin.
        * @param      vhrNrds       the NodeRevisionDescriptors of the associated VHR.
  +     * @param      isForkOk      indicates if <code>&lt;fork-ok&gt;</code> is set in
  +     *                           the request content.
        *
        * @return     the ViolatedPrecondition (if any).
        */
  -    private ViolatedPrecondition getCheckinPreconditionViolation(NodeProperty 
predSetProp, NodeRevisionDescriptors vhrNrds) throws LinkedObjectNotFoundException, 
ServiceAccessException, ObjectLockedException, RevisionDescriptorNotFoundException, 
JDOMException, IllegalArgumentException, ObjectNotFoundException, 
AccessDeniedException {
  +    private ViolatedPrecondition getCheckinPreconditionViolation(NodeProperty 
predSetProp, NodeRevisionDescriptors vhrNrds, boolean isForkOk) throws 
LinkedObjectNotFoundException, ServiceAccessException, ObjectLockedException, 
RevisionDescriptorNotFoundException, JDOMException, IllegalArgumentException, 
ObjectNotFoundException, AccessDeniedException {
           
           ViolatedPrecondition violatedPrecondition = null;
           
  @@ -599,7 +601,7 @@
                               }
                               
                               // check precondition C_CHECKIN_FORK_DISCOURAGED
  -                            else if 
(E_DISCOURAGED.equals(predecessorCheckinForkProperty.getValue()) && !isForkOK() ) {
  +                            else if 
(E_DISCOURAGED.equals(predecessorCheckinForkProperty.getValue()) && !isForkOk ) {
                                   violatedPrecondition = new 
ViolatedPrecondition(C_CHECKIN_FORK_FORBIDDEN, WebdavStatus.SC_CONFLICT);
                               }
                           }
  @@ -693,20 +695,6 @@
               errorElement.addContent(preconditionElement);
               new XMLOutputter().output(errorElement, resp.getWriter());
           }
  -    }
  -    
  -    /**
  -     * Returns <code>true</code> if the request content contains a
  -     * <code>&lt;fork-ok&gt;</code> element.
  -     *
  -     * @return     <code>true</code> if the request content contains a
  -     *             <code>&lt;fork-ok&gt;</code> element.
  -     */
  -    protected boolean isForkOK() {
  -        
  -        return (requestContent != null) &&
  -            (requestContent.getRootElement().getChild(E_FORK_OK,
  -                                                      
Namespace.getNamespace(DEFAULT_NAMESPACE)) != null);
       }
       
       
  
  
  

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

Reply via email to