remm        01/02/15 09:40:37

  Modified:    src/webdav/client/src/org/apache/webdav/lib
                        Authenticator.java
               src/webdav/client/src/org/apache/webdav/lib/methods
                        LockMethod.java PropFindMethod.java
                        PropPatchMethod.java WebdavMethodBase.java
                        XMLResponseMethodBase.java
               src/webdav/client/src/org/apache/webdav/util
                        WebdavResource.java
  Removed:     src/webdav/client/src/org/apache/webdav/lib/util Base64.java
                        DOMUtils.java DOMWriter.java MD5Encoder.java
                        MIME2Java.java WebdavXMLPrinter.java
  Log:
  - Some util classes have been moved around (and some have been renamed).
  - Add URL escaping on the client too.
    Path submitted by Michael Smith <[EMAIL PROTECTED]>.
  
  Revision  Changes    Path
  1.5       +4 -4      
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Authenticator.java
  
  Index: Authenticator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Authenticator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Authenticator.java        2000/12/12 07:15:50     1.4
  +++ Authenticator.java        2001/02/15 17:40:11     1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Authenticator.java,v
 1.4 2000/12/12 07:15:50 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/12/12 07:15:50 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/Authenticator.java,v
 1.5 2001/02/15 17:40:11 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/02/15 17:40:11 $
    *
    * ====================================================================
    *
  @@ -63,7 +63,7 @@
   
   package org.apache.webdav.lib;
   
  -import org.apache.webdav.lib.util.Base64;
  +import org.apache.util.Base64;
   
   /**
    * Authenticate helper.
  
  
  
  1.13      +5 -5      
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java
  
  Index: LockMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LockMethod.java   2001/02/07 05:59:09     1.12
  +++ LockMethod.java   2001/02/15 17:40:15     1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v
 1.12 2001/02/07 05:59:09 remm Exp $
  - * $Revision: 1.12 $
  - * $Date: 2001/02/07 05:59:09 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/LockMethod.java,v
 1.13 2001/02/15 17:40:15 remm Exp $
  + * $Revision: 1.13 $
  + * $Date: 2001/02/15 17:40:15 $
    *
    * ====================================================================
    *
  @@ -78,8 +78,8 @@
   
   import org.apache.webdav.lib.properties.LockEntryProperty;
   
  -import org.apache.webdav.lib.util.DOMUtils;
  -import org.apache.webdav.lib.util.DOMWriter;
  +import org.apache.util.DOMUtils;
  +import org.apache.util.DOMWriter;
   
   import org.w3c.dom.Attr;
   import org.w3c.dom.Document;
  
  
  
  1.15      +13 -15    
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java
  
  Index: PropFindMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- PropFindMethod.java       2001/02/05 18:20:11     1.14
  +++ PropFindMethod.java       2001/02/15 17:40:17     1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java,v
 1.14 2001/02/05 18:20:11 remm Exp $
  - * $Revision: 1.14 $
  - * $Date: 2001/02/05 18:20:11 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropFindMethod.java,v
 1.15 2001/02/15 17:40:17 remm Exp $
  + * $Revision: 1.15 $
  + * $Date: 2001/02/15 17:40:17 $
    *
    * ====================================================================
    *
  @@ -70,6 +70,8 @@
   import java.util.Hashtable;
   import java.util.Vector;
   
  +import org.apache.util.XMLPrinter;
  +
   import org.apache.webdav.lib.Header;
   import org.apache.webdav.lib.Property;
   import org.apache.webdav.lib.State;
  @@ -79,8 +81,6 @@
   import org.apache.webdav.lib.properties.GetLastModifiedProperty;
   import org.apache.webdav.lib.properties.ResourceTypeProperty;
   
  -import org.apache.webdav.lib.util.WebdavXMLPrinter;
  -
   /**
    * This class implements the WebDAV PROPFIND Method.
    *
  @@ -316,32 +316,30 @@
           if (query != null) 
               return query;
   
  -        WebdavXMLPrinter printer = new WebdavXMLPrinter();
  +        XMLPrinter printer = new XMLPrinter();
           printer.writeXMLHeader();
           printer.writeElement("D", "DAV:", "propfind",
  -                             WebdavXMLPrinter.OPENING);
  +                             XMLPrinter.OPENING);
   
           switch (type) {
           case ALL:
  -            printer.writeElement("D", "allprop", WebdavXMLPrinter.NO_CONTENT);
  +            printer.writeElement("D", "allprop", XMLPrinter.NO_CONTENT);
               break;
           case NAMES:
  -            printer.writeElement("D", "propname",
  -                                 WebdavXMLPrinter.NO_CONTENT);
  +            printer.writeElement("D", "propname", XMLPrinter.NO_CONTENT);
               break;
           case BY_NAME:
  -            printer.writeElement("D", "prop", WebdavXMLPrinter.OPENING);
  +            printer.writeElement("D", "prop", XMLPrinter.OPENING);
               while (propertyNames.hasMoreElements()) {
                   String propertyName = (String) propertyNames.nextElement();
                   printer.writeElement(null, propertyName,
  -                                     WebdavXMLPrinter.NO_CONTENT);
  +                                     XMLPrinter.NO_CONTENT);
               }
  -            printer.writeElement("D", "prop", WebdavXMLPrinter.CLOSING);
  +            printer.writeElement("D", "prop", XMLPrinter.CLOSING);
               break;
           }
   
  -        printer.writeElement("D", "DAV:", "propfind",
  -                             WebdavXMLPrinter.CLOSING);
  +        printer.writeElement("D", "DAV:", "propfind", XMLPrinter.CLOSING);
           if (debug > 1) {
               System.out.println("Request body:");
               System.out.println(printer.toString());
  
  
  
  1.12      +16 -25    
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropPatchMethod.java
  
  Index: PropPatchMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropPatchMethod.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PropPatchMethod.java      2001/02/05 18:20:12     1.11
  +++ PropPatchMethod.java      2001/02/15 17:40:18     1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropPatchMethod.java,v
 1.11 2001/02/05 18:20:12 remm Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/02/05 18:20:12 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropPatchMethod.java,v
 1.12 2001/02/15 17:40:18 remm Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/02/15 17:40:18 $
    *
    * ====================================================================
    *
  @@ -68,10 +68,10 @@
   import javax.xml.parsers.DocumentBuilderFactory;
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.ParserConfigurationException;
  +import org.apache.util.XMLPrinter;
   import org.apache.webdav.lib.State;
   import org.apache.webdav.lib.Header;
   import org.apache.webdav.lib.WebdavStatus;
  -import org.apache.webdav.lib.util.WebdavXMLPrinter;
   
   
   /**
  @@ -230,56 +230,47 @@
           if (query != null) 
               return query;
   
  -        WebdavXMLPrinter printer = new WebdavXMLPrinter();
  +        XMLPrinter printer = new XMLPrinter();
           printer.writeXMLHeader();
           printer.writeElement("D", "DAV:", "propertyupdate",
  -                             WebdavXMLPrinter.OPENING);
  +                             XMLPrinter.OPENING);
   
           if (toSet.size() > 0) {
   
  -            printer.writeElement("D", null, "set",
  -                                 WebdavXMLPrinter.OPENING);
  +            printer.writeElement("D", null, "set", XMLPrinter.OPENING);
   
               Enumeration toSetList = toSet.elements();
               while (toSetList.hasMoreElements()) {
                   Property current = (Property) toSetList.nextElement();
  -                printer.writeElement("D", null, "prop",
  -                                     WebdavXMLPrinter.OPENING);
  +                printer.writeElement("D", null, "prop", XMLPrinter.OPENING);
                   printer.writeProperty(current.namespace, current.namespaceInfo,
                                         current.name, current.value);
  -                printer.writeElement("D", null, "prop",
  -                                     WebdavXMLPrinter.CLOSING);
  +                printer.writeElement("D", null, "prop", XMLPrinter.CLOSING);
               }
   
  -            printer.writeElement("D", null, "set",
  -                                 WebdavXMLPrinter.CLOSING);
  +            printer.writeElement("D", null, "set", XMLPrinter.CLOSING);
   
           }
   
           if (toRemove.size() > 0) {
   
  -            printer.writeElement("D", null, "remove",
  -                                 WebdavXMLPrinter.OPENING);
  +            printer.writeElement("D", null, "remove", XMLPrinter.OPENING);
   
               Enumeration toRemoveList = toRemove.elements();
               while (toRemoveList.hasMoreElements()) {
                   Property current = (Property) toRemoveList.nextElement();
  -                printer.writeElement("D", null, "prop",
  -                                     WebdavXMLPrinter.OPENING);
  +                printer.writeElement("D", null, "prop", XMLPrinter.OPENING);
                   printer.writeElement(current.namespace, current.namespaceInfo,
  -                                     current.name,
  -                                     WebdavXMLPrinter.NO_CONTENT);
  -                printer.writeElement("D", null, "prop",
  -                                     WebdavXMLPrinter.CLOSING);
  +                                     current.name, XMLPrinter.NO_CONTENT);
  +                printer.writeElement("D", null, "prop", XMLPrinter.CLOSING);
               }
   
  -            printer.writeElement("D", null, "remove",
  -                                 WebdavXMLPrinter.CLOSING);
  +            printer.writeElement("D", null, "remove", XMLPrinter.CLOSING);
   
           }
   
           printer.writeElement("D", "DAV:", "propertyupdate",
  -                             WebdavXMLPrinter.CLOSING);
  +                             XMLPrinter.CLOSING);
   
           query = printer.toString();
           return query;
  
  
  
  1.11      +6 -4      
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/WebdavMethodBase.java
  
  Index: WebdavMethodBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/WebdavMethodBase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WebdavMethodBase.java     2001/02/05 18:20:14     1.10
  +++ WebdavMethodBase.java     2001/02/15 17:40:19     1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/WebdavMethodBase.java,v
 1.10 2001/02/05 18:20:14 remm Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/02/05 18:20:14 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/WebdavMethodBase.java,v
 1.11 2001/02/15 17:40:19 remm Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/02/15 17:40:19 $
    *
    * ====================================================================
    *
  @@ -65,6 +65,7 @@
   
   import java.io.*;
   import java.util.*;
  +import org.apache.util.URLUtil;
   import org.apache.webdav.lib.State;
   import org.apache.webdav.lib.Cookie;
   import org.apache.webdav.lib.Header;
  @@ -480,7 +481,8 @@
        */
       public final String generateRequestLine() {
   
  -        return (getName() + " " + path + " " + PROTOCOL + "\r\n");
  +        return (getName() + " " + URLUtil.URLEncode(path, "UTF8") + " " 
  +                + PROTOCOL + "\r\n");
   
       }
   
  
  
  
  1.7       +4 -3      
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/XMLResponseMethodBase.java
  
  Index: XMLResponseMethodBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/XMLResponseMethodBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLResponseMethodBase.java        2001/02/11 21:04:58     1.6
  +++ XMLResponseMethodBase.java        2001/02/15 17:40:20     1.7
  @@ -85,8 +85,9 @@
   import org.apache.webdav.lib.properties.GetLastModifiedProperty;
   import org.apache.webdav.lib.properties.ResourceTypeProperty;
   
  -import org.apache.webdav.lib.util.DOMUtils;
  -import org.apache.webdav.lib.util.DOMWriter;
  +import org.apache.util.URLUtil;
  +import org.apache.util.DOMUtils;
  +import org.apache.util.DOMWriter;
   
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
  @@ -365,7 +366,7 @@
           public String getHref() {
               Element href = getFirstElement("DAV:", "href");
               if (href != null) {
  -                return DOMUtils.getTextValue(href);
  +                return URLUtil.URLDecode(DOMUtils.getTextValue(href));
               } else {
                   return "";
               }
  
  
  
  1.3       +4 -4      
jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java
  
  Index: WebdavResource.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WebdavResource.java       2001/02/09 16:24:46     1.2
  +++ WebdavResource.java       2001/02/15 17:40:35     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java,v
 1.2 2001/02/09 16:24:46 juergen Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/02/09 16:24:46 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/util/WebdavResource.java,v
 1.3 2001/02/15 17:40:35 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/02/15 17:40:35 $
    *
    * ====================================================================
    *
  @@ -73,10 +73,10 @@
   import java.util.Hashtable;
   import java.util.Enumeration;
   import java.text.DateFormat;
  +import org.apache.util.DOMUtils;
   import org.apache.webdav.lib.*;
   import org.apache.webdav.lib.properties.*;
   import org.apache.webdav.lib.methods.*;
  -import org.apache.webdav.lib.util.DOMUtils;
   
   /**
    * Abstracts the concept of a resource on a WebDAV server.
  
  
  

Reply via email to