Login | Register
My pages Projects Community openCollabNet

Discussions > users > Re: [Subclipse-users] Can't create folder with square brackets

subclipse
Discussion topic

Back to topic list

Re: [Subclipse-users] Can't create folder with square brackets

Author selsemore
Full name Stephen Elsemore
Date 2014-10-23 07:07:09 PDT
Message I was able to reproduce the problem by right clicking a folder in the SVN
Repositories view, selecting New -> New remote folder, and then trying to
add a folder with square brackets in the name. I got:

org.apache.subversio​n.javahl.ClientExcep​tion: Bogus URL svn: URL
'myurlwithbrackets' is not properly URI-encoded

I got similar errors if I tried to show history for a folder or file with
square brackets in the name.

On Thu, Oct 23, 2014 at 4:01 PM, Mark Phippard <markphip at gmail dot com> wrote:

> On Thu, Oct 23, 2014 at 9:45 AM, David Balažic <david dot balazic at comtrade dot com
> > wrote:
>
>
>> I was curious and tried to reproduce the problem, but could not.
>>
>> I have Eclipse Kepler SR-2 (v4.3.2) with:
>>
>> Subclipse (Required) 1.10.5
>>
>> Subversion Client Adapter (Required) 1.10.1
>>
>> Subversion JavaHL Native Library Adapter 1.8.10
>>
>>
>>
>> With repository on VisualSVN Server 3.0.0
>>
>>
>>
>> I created , updated, viewed the log of a folder with sqaure brackets in
>> its name but everything worked without error.
>>
>> Does the error happen in some special circumstances?
>>
>>
>> Steve fixed this before I ever tried it. Not sure what he did to test
> it. The OP mentions creating a folder. Did you try doing it against the
> remote repository? It is possible you do not see this if you do it locally
> and then just commit the folder.
>
> In general, when a URL is passed to the SVN API it has to be URI-encoded.
> So, as an example, we have to convert spaces to %20. Any character that
> has to be converted to a %xx value has to be done this way. We handle this
> in the toString() method of our SVNUrl class:
>
> public String toString() {
> // The URI class will throw Exception if there are spaces in the URL, but it seems // to handle other classes OK. I tested with @ + and Unicode characters. It leaves // the @ and + alone and converts Unicode to %nn. It is possible there are other // characters we need to replace here besides space. String s = get().replace(" ", "%20").replace("[", "%5B").replace("]","%5D");
> try {
> URI u = new URI(s);
> return u.toASCIIString();
> } catch (URISyntaxException e) {
> return s;
> }
> }
>
>
> So most of the work happens in the URI.toASCIIString() method that we
> call. As the comment notes, this method does not convert spaces (and
> possibly other characters). I assume that Steve confirmed that it does not
> convert brackets and so he added those to the manual exceptions. I have
> not checked if that is right or wrong, but that is what is needed here in
> general.
>
> SVN itself handles all of this fine internally. The only issue is when we
> have to directly provide one of these URL's in an API call.
>
> --
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/
>
Attachments

« Previous message in topic | 5 of 9 | Next message in topic »

Messages

Show all messages in topic

[Subclipse-users] Can't create folder with square brackets Lukáš Cek <cek at kadel dot cz> Lukáš Cek <cek at kadel dot cz> 2014-10-21 01:06:31 PDT
     RE: [Subclipse-users] Can selsemore Stephen Elsemore 2014-10-21 04:09:24 PDT
     RE: [Subclipse-users] Can't create folder with square brackets David Balažic <david dot balazic at comtrade dot com> David Balažic <david dot balazic at comtrade dot com> 2014-10-23 06:45:49 PDT
         Re: [Subclipse-users] Can't create folder with square brackets markphip Mark Phippard 2014-10-23 07:01:29 PDT
             Re: [Subclipse-users] Can't create folder with square brackets selsemore Stephen Elsemore 2014-10-23 07:07:09 PDT
                 RE: [Subclipse-users] Can't create folder with square brackets David Balažic <david dot balazic at comtrade dot com> David Balažic <david dot balazic at comtrade dot com> 2014-10-24 04:05:55 PDT
                     Re: [Subclipse-users] Can't create folder with square brackets markphip Mark Phippard 2014-10-24 04:11:51 PDT
                         RE: [Subclipse-users] Can't create folder with square brackets David Balažic <david dot balazic at comtrade dot com> David Balažic <david dot balazic at comtrade dot com> 2014-10-24 05:02:27 PDT
                             Re: [Subclipse-users] Can't create folder with square brackets markphip Mark Phippard 2014-10-24 06:07:45 PDT
Messages per page: