Upayavira wrote:
Gianugo Rabellino wrote:
Murray Altheim wrote:
[...]
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...

You could, instead, look into the Avalon Excalibur source resolver, which is used by Cocoon. It gives you an abstraction that allows you to do that. Also, with the XMLDBSource in the Cocoon XMLDB block, you've effectively got a way of reading/writing to/from a XMLDB 'thing'.

Upayavira,

I'll take a look at that. I also found this:

  Java 1.2 Unleashed: Content and Protocol Handlers
  http://utenti.lycos.it/yanorel6/2/ch33.htm

which seems to provide a solution too.

Thanks,

Murray

......................................................................
Murray Altheim                    http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK               .

  "Ours is a dangerous time with two relatively new threats,
   both of them exacerbated by the Iraq invasion and this
   administration's policies. One is the threat of future
   terrorism by Osama and al Qaeda. The other is the threat
   to our freedoms and our constitutional republic. These
   are dangers that were never faced before in my lifetime."
                                             -- Daniel Ellsberg
   
http://www.sfgate.com/cgi-bin/article.cgi?file=/chronicle/archive/2004/02/29/CMG3R50LHE5.DTL



Reply via email to