santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Putman <putm...@georgetown.edu>
Subject Re: Overriding config.xml
Date Tue, 29 Jan 2008 23:05:37 GMT
Well, it's undocumented AFAIK, so I don't know if this is considered 
"stable", but: You can set a system property 
"org.apache.xml.security.resource.config",  prior to calling 
Init.init(), which controls which resource is loaded as the config file. 

Here's the code from Init which does the actual loading.  It uses 
Class#getResourceAsStream as you can see.  So you should be able to put 
the alternative config file in your own jar file or elsewhere on your 
classpath, as long as it can be loaded as a resource in this manner.

InputStream is = (InputStream) AccessController.doPrivileged(
        new PrivilegedAction() {
            public Object run() {
               String cfile = 
System.getProperty("org.apache.xml.security.resource.config");
               return getClass().getResourceAsStream(cfile != null ? 
cfile : "resource/config.xml");
            }
        }
);

jason marshall wrote:
> Does anyone have a good description of how to override the config.xml 
> file without modifying the xml-sec.jar file?
>
> I can't see a way to get the config.xml file somewhere that Init can 
> see it, short of modifying the Jar, and if I have to do that, I'll 
> just modify the config.xml file in place.
>
> Thanks,
> Jason

Mime
View raw message