Subject: [URN] ANN: Java URI Code v0.6

From: Justin Couch <[email-masked]>
Date: Fri, 26 Mar 1999 10:49:49 +0800

A new update to the URI code is now available.

v0.6 gets me much further along the line of being able to completely
replace the java.net packages with something sane that can handle URNs
That is, I've put in a huge effort to up the number of supported
protocol types to include all of the common ones except FTP. I've added
the changes.txt file below to see the amount of upgrades that I've done.

A new trivial THTTP resolver has been added. The DNS NAPTR resolver has
not yet made it to the public release because the licensing restricts it
from commercial use. I may release that as a separate package.

This release proves the multiple RDS handling concepts that I have been
writing about. The THTTP handler was almost trivial to write once the
HTTP handler was in place (about 14 hours it took). Assuming other
libraries are available, other resolvers should take around the same
time making this an excellent platform for prototyping new resolver
schemes without modifying application code. 

-- 
Justin Couch                                   Author, Java Hacker
Snr Software Engineer                     [email-masked]
ADI Ltd, Systems Group              http://www.vlc.com.au/~justin/
Java3D FAQ:       http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
 Turn it or move it, and a new set of arrangements appears... is it
 a single light or many lights, lights that one must know how to
 distinguish, recognise and appreciate? Is it one light with many
 frames or one frame for many lights?"      -Subcomandante Marcos
-------------------------------------------------------------------

URI Class libraries
--------------------

Changes between 0.5 and 0.6
----------------------------

- Rewrote the internals of URL. Now no longer delegates to java.net.URL. All
done internally.

- Added method to strip a file into path, query and reference parts to
URIUtils. Required some heavy reorganisation of URIUtils internally. Lots of
new smaller methods to do stuff.

- Added convenience method to URIUtils to take a string and return a URI
object.

- Made some changes to protocol.file.FileResourceConnection to deal with
query parts. Was handling these wrong and looking for a filename with with ?
as part of it if there was a query string.

- Added last modified time to ResourceConnection. Updated
FileResourceConnection to override this which returns File.lastModified.

- Added text/uri-list content handler

- Added simple data: protocol handler.

- Fixed bug in text/plain content handler for the read from stream. Was reading
too many characters that were being appended to the string buffer.

- HttpResourceConnection now deals with proxy information and fields for
allowing the use of cookies.

- Basic implemetation of HttpResourceConnection using Innovation HTTPClient
classes (LGPL'd) - http://www.innovation.ch/java/HTTPClient/ . Does all the
standard stuff, plus PUT/POST, but nothing special. Can fetch images etc.

- due to the nature of the HTTPClient code, this allows _very_ quick adaption
to include HTTPS and SHTTP as well. Problem is that no authentication system is
currently available (on the TBD list) so it sorta doesn't work. At least it
finds the handlers and loads them

- added x-java/jar content handler to load JAR files from a network

- added JarResourceConnection based class and implementation. JAR URLs are now
extended from the base Sun definition allowing you to describe a JAR file using
a URN as the location eg urn:x-java:myfile.jar!/someclass.class that will use
the URN system to automatically locate a JAR file.
  o Should implement a resolver type that looks in the classpath for these files.
  o Should implement a URNClassLoader to take advantage of this.

- Strip excess constants from URI that were in URIConstants and all the default
port stuff from URI. URI.getDefaultPort marked deprecated - to be removed in
v0.7

- error in URIUtils parsing of authority. When parsing file:/// it worked fine
but for JAR URLs that had jar:file:/// it mistakenly thought that file: was the
authority definition. It now first checks for the existance of // before
looking for the authority section.

- removed dead code in file based resolver Resolver and FileParser

- Added THTTP resolver. Only handles text/uri-list at this stage. HTML handler
to come shortly and same with redirects for N2R. Not tested yet.

Justin Couch
25 March 1999