luetzkendorf    2004/10/28 07:48:45

  Modified:    src/webdav/server/org/apache/slide/webdav/method Tag:
                        SLIDE_2_1_RELEASE_BRANCH PutMethod.java
  Log:
  patch from thomas draier for bug 31937.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.81.2.3  +23 -8     
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.81.2.2
  retrieving revision 1.81.2.3
  diff -u -r1.81.2.2 -r1.81.2.3
  --- PutMethod.java    12 Sep 2004 17:27:41 -0000      1.81.2.2
  +++ PutMethod.java    28 Oct 2004 14:48:45 -0000      1.81.2.3
  @@ -63,7 +63,7 @@
    */
   public class PutMethod
       extends AbstractWebdavMethod
  -    implements DeltavConstants, WriteMethod {
  +    implements DeltavConstants, WriteMethod, FineGrainedLockingMethod {
       
   
       // ----------------------------------------------------- Instance Variables
  @@ -91,7 +91,18 @@
           super(token, config);
       }
       
  -    
  +    /**
  +     * @see 
org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        acquireStandardLocks(resourcePath);
  +        // lock history folder in case we have auto versioning turned on
  +        acquireHistoryLocks(resourcePath);
  +        // changes this and parent
  +        acquireLock(resourcePath, WRITE_LOCK);
  +        acquireParentLock(resourcePath, WRITE_LOCK);
  +    }
  +
       // ------------------------------------------------------ Protected Methods
       
       
  @@ -325,9 +336,6 @@
                   // Get content language
                   revisionDescriptor.setContentLanguage("en");
                   
  -                // Get content length
  -                revisionDescriptor.setContentLength(req.getContentLength());
  -                
                   // Get content type
                   String contentType = req.getContentType();
                   if (contentType == null) {
  @@ -388,6 +396,13 @@
                   NodeRevisionContent revisionContent =
                       new NodeRevisionContent();
                   revisionContent.setContent(req.getInputStream());
  +                
  +                // Get content length
  +                int contentLength = req.getContentLength();
  +                if (contentLength == -1) {
  +                    contentLength = revisionContent.getContentBytes().length;
  +                }
  +                revisionDescriptor.setContentLength(contentLength);
                   
                   content.create(slideToken, resourcePath, revisionDescriptor,
                                  revisionContent);
  
  
  

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

Reply via email to