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 ma...@apache.org on 2005/03/17 08:20:59 UTC

cvs commit: jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib WebdavResource.java

masonjm     2005/03/16 23:20:59

  Modified:    webdavclient/clientlib/src/java/org/apache/webdav/lib
                        WebdavResource.java
  Log:
  Fix for bug #32886
  
  Revision  Changes    Path
  1.36      +14 -11    jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java
  
  Index: WebdavResource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- WebdavResource.java	23 Feb 2005 12:47:00 -0000	1.35
  +++ WebdavResource.java	17 Mar 2005 07:20:59 -0000	1.36
  @@ -1078,12 +1078,12 @@
               String displayName = workingResource.getDisplayName();
       
               if (displayName == null || displayName.trim().equals("")) {
  -                displayName = getName(href);
  +                displayName = getName(href, true);
               }
               if (!itself) {
                   String myURI = httpURL.getEscapedURI();
                   char[] childURI = (myURI + (myURI.endsWith("/") ? "" : "/")
  -                                   + URIUtil.getName(href)).toCharArray();
  +                                   + getName(href, false)).toCharArray();
                   HttpURL childURL = httpURL instanceof HttpsURL
                                      ? new HttpsURL(childURI)
                                      : new HttpURL(childURI);
  @@ -1511,7 +1511,7 @@
        * @see org.apache.commons.httpclient.HttpURL#getName()
        */
       public String getName() {
  -        return getName(httpURL.getEscapedPath());
  +        return getName(httpURL.getEscapedPath(), true);
       }
   
   
  @@ -5393,14 +5393,17 @@
   
       
       
  -    private static String getName(String uri) {
  +    private static String getName(String uri, boolean decode) {
           String escapedName = URIUtil.getName(
               uri.endsWith("/") ? uri.substring(0, uri.length() - 1): uri);
  -        try {
  -            return URIUtil.decode(escapedName);
  -        } catch (URIException e) {
  -            return escapedName;
  +        if (decode) {
  +            try {
  +                return URIUtil.decode(escapedName);
  +            } catch (URIException e) {
  +                // Oh well
  +            }
           }
  +        return escapedName;
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org