[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Subversion canonical URI

From: Mark Phippard <markphip_at_gmail.com>
Date: Fri, 24 Oct 2014 09:06:13 -0400

When we use the Subversion API via JavaHL it is up to the caller to provide
repository URI in proper encoded format, such as %20 for spaces. I have
never found the perfect Java method for doing this. In Subclipse, we are
currently using this method:

http://docs.oracle.com/javase/7/docs/api/java/net/URI.html#toASCIIString()

It does a good job handling UTF8 characters, but as an example it does not
convert spaces to %20 so we have do that ourselves. There are other
characters like [, ], #, % it does not convert. So it is kind of a
constant battle to workaround the differences.

I have a couple questions:

1) Could JavaHL itself expose a Subversion library method that could do
this for us? I assume Subversion must have some method that it uses to
canonicalize a URL. Maybe this could just be exposed to JavaHL. Pass it a
String and get back the canonical version?

2) Is the Subversion URI format governed by a specific RFC? Mainly asking
that question for an alternative to #1. If we are searching for a better
Java method to use and they mention an RFC it would help to find a better
fit.

I am not sure if I am using "canonical" correctly here. I assume you get
the gist of what I am asking though.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
Received on 2014-10-24 15:08:12 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.