Bug 26701

Summary: Enabling web applications to register their own stream handlers
Product: Tomcat 4 Reporter: Sankaranarayanan Ganapathy <sganapathy>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: enhancement CC: sganapathy
Priority: P3    
Version: 4.1.24   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Sankaranarayanan Ganapathy 2004-02-05 21:30:18 UTC
A stream handler factory can be registered once per VM and tomcat registers the 
DirContextStreamHandlerFactory for the jndi protocol. However if there are web 
applications running inside that want to register handlers for custom scheme 
currently it is not possible.

Can the DirContextStreamHandlerFactory be enhanced to allow applications to 
register stream handler for custom schemes they might have. Or better can this 
be a made a property in the context.xml file ?

Is this already there - or can this enhanced in the future?
Comment 1 Mark Thomas 2011-03-06 17:15:06 UTC
This has been fixed in 7.0.x and will be included in 7.0.11 onwards.

Add as many factories as you wish using:
DirContextURLStreamHandlerFactory#addUserFactory(URLStreamHandlerFactory factory)

The class loader hierarchy means that the factory will have to be in $CATALINA_BASE/lib.
Comment 2 Mark Thomas 2011-03-08 06:05:33 UTC
I would add that adding stream handlers via the java.protocol.handler.pkgs system property was and remains an alternative option.