juergen     2002/08/22 06:43:32

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        CheckinMethod.java CheckoutMethod.java
  Log:
  the location header is expected to be utf-8 encoded
  
  Revision  Changes    Path
  1.17      +26 -34    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java
  
  Index: CheckinMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CheckinMethod.java        12 Aug 2002 12:55:02 -0000      1.16
  +++ CheckinMethod.java        22 Aug 2002 13:43:32 -0000      1.17
  @@ -62,28 +62,19 @@
    */
   package org.apache.slide.webdav.method;
   
  -import java.io.*;
  -import java.util.*;
  -
  -import javax.servlet.http.HttpServletRequest;
  -import javax.servlet.http.HttpServletResponse;
  -
  -import org.jdom.Element;
  -import org.jdom.Document;
  -import org.jdom.Namespace;
  -import org.jdom.JDOMException;
  -import org.jdom.output.XMLOutputter;
  -
  +import java.io.IOException;
  +import java.util.Iterator;
   import org.apache.slide.common.Domain;
   import org.apache.slide.common.NamespaceAccessToken;
  -import org.apache.slide.common.SlideException;
  -import org.apache.slide.webdav.WebdavServletConfig;
   import org.apache.slide.webdav.WebdavException;
  -import org.apache.slide.webdav.util.VersioningHelper;
  +import org.apache.slide.webdav.WebdavServletConfig;
   import org.apache.slide.webdav.util.DeltavConstants;
  -import org.apache.slide.webdav.util.ViolatedPrecondition;
   import org.apache.slide.webdav.util.PreconditionViolationException;
  +import org.apache.slide.webdav.util.VersioningHelper;
  +import org.apache.slide.webdav.util.WebdavUtils;
   import org.apache.util.WebdavStatus;
  +import org.jdom.Element;
  +import org.jdom.JDOMException;
   
   /**
    * CHECKIN method.
  @@ -91,21 +82,21 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Ralf Stuckert</a>
    */
   public class CheckinMethod extends AbstractWebdavMethod implements DeltavConstants {
  -    
  +
       /** Resource to be written. */
       private String resourcePath;
  -    
  +
       /** Marshalling variables */
       private boolean forkOk = false;
       private boolean keepCheckedOut = false;
  -    
  -    
  +
  +
       // ----------------------------------------------------------- Constructors
  -    
  -    
  +
  +
       /**
        * Constructor.
  -     * 
  +     *
        * @param token     the token for accessing the namespace
        * @param config    configuration of the WebDAV servlet
        */
  @@ -113,20 +104,20 @@
                            WebdavServletConfig config) {
           super(token, config);
       }
  -    
  +
       /**
        * Parse WebDAV XML query.
        *
        * @throws WebdavException
        */
       protected void parseRequest() throws WebdavException {
  -        
  +
           resourcePath = requestUri;
           if (resourcePath == null) {
               resourcePath = "/";
           }
  -        
  -        
  +
  +
           if( req.getContentLength() > 0 ) {
               readRequestContent();
               try{
  @@ -166,10 +157,10 @@
        */
       protected void executeRequest() throws WebdavException, IOException {
           String locationValue = null;
  -        
  +
           // Prevent dirty reads
           slideToken.setForceStoreEnlistment(true);
  -        
  +
           try {
               VersioningHelper vh = VersioningHelper.getVersioningHelper(
                   slideToken, token, req, resp, getConfig() );
  @@ -180,7 +171,7 @@
               throw e;
           }
           catch (Exception e) {
  -            int statusCode = getErrorCode(e);
  +            int statusCode = getErrorCode( e );
               sendError( statusCode, e );
               throw new WebdavException( statusCode );
           }
  @@ -188,7 +179,8 @@
               resp.setHeader(H_CACHE_CONTROL, NO_CACHE);
               if( locationValue != null && locationValue.length() > 0 ) {
                   locationValue = getFullPath( locationValue );
  -                resp.setHeader( H_LOCATION, locationValue );
  +                // the location header is "utf-8" expected
  +                resp.setHeader( H_LOCATION, WebdavUtils.encodeURL(locationValue, 
"utf-8") );
               }
           }
       }
  
  
  
  1.21      +6 -4      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java
  
  Index: CheckoutMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- CheckoutMethod.java       22 Aug 2002 12:49:09 -0000      1.20
  +++ CheckoutMethod.java       22 Aug 2002 13:43:32 -0000      1.21
  @@ -232,7 +232,8 @@
               resp.setHeader(H_CACHE_CONTROL, NO_CACHE);
               if( locationValue != null && locationValue.length() > 0 ) {
                   locationValue = getFullPath( locationValue );
  -                resp.setHeader( H_LOCATION, locationValue );
  +                // the location header is "utf-8" expected
  +                resp.setHeader( H_LOCATION, WebdavUtils.encodeURL(locationValue, 
"utf-8") );
               }
           }
   
  @@ -240,5 +241,6 @@
   
   
   }
  +
   
   
  
  
  

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

Reply via email to