Quoting Patrick Gostovic <[EMAIL PROTECTED]>:

> I've just started looking into using the Slide WebDav Client API, trying
> it
> out, etc.  It's nice - really intuitive.
> 
> However, I can't get the Copy or the Move methods to work on their own.
> The
> problem seems to revolve around the setting of the Destination header.
> According to the spec I was reading, the Destination header should be
> an
> Absolute URI.  Sadly, if I try to set the destination (i.e.
> CopyMethod.setDestination(..) ) to an absolute uri, the URLEncoder
> (org.apache.util.URLUtil.URLEncode(..) ) mangles it -- actually, it's
> only
> the colon (":") that gets mangled.
> 
> Now, you probably don't want to include...
> 
>        safeCharacters.set(':');
>
> ... in that static part at the top of org.apache.util.URLUtil because,
> although that would fix this particular problem, it would break the
> URLEncoder. 

Indeed. I didn't think about the consequences about encoding the whole thing, 
because I forgot it was an absolute URL here.

> So, I would suggest changing the setDestination method (in
> org.apache.webdav.lib.methods.CopyMethod & MoveMethod):
> 
> from:
>       public void setDestination(String destination)
> 
> to:
>       public void setDestination(String protocol, String host, int port,
> String
> destination)
> 
> ... or have both, but if the first one is used, then the sessionHost
> and
> sessionPort are automatically appended.

Yes, I think I'll do that. setDestination(destination) should accept a relative 
URL, to be consistent with the method.setPath(path) call.

Remy

Reply via email to