Murray Altheim wrote:

I thought perhaps if I needed an answer to this question, others
might as well. I also figure that someone on this list has the
answer to this one at their fingertips...

For those programming in Java, the java.net.URL class is
ubiquitous. But creating a URL with 'xmldb' such as

  xmldb:xindice-embed:///db/documentation/overview

will result in

   [java] java.net.MalformedURLException: unknown protocol: xmldb
   [java]     at java.net.URL.<init>(URL.java:586)
   [java]     at java.net.URL.<init>(URL.java:476)
   [...]

which never feels all that much like a warm puppy or a cold beer.

So the question is: how does one register a new protocol in Java
so that you can create xmldb URLs and obtain a valid String when
doing getProtocol()?

URLStreamHandlerFactory is your friend and foe. It's your friend since it allows you to add a custom protocol to Java, it's your foe since only exactly ONE additional protocol per JVM is allowed. I think that the double colon issue can be somehow solves, but this limitation is quite hard to digest...


Ciao,


-- Gianugo Rabellino Pro-netics s.r.l. - http://www.pro-netics.com Orixo, the XML business alliance - http://www.orixo.com (Blogging at: http://www.rabellino.it/blog/)

Reply via email to