I am trying to read an INI file from the same location as the default
shiro.ini (either "/WEB-INF/shiro.ini" or "classpath:shiro.ini").
The obvious approach fails:
Ini ini = Ini.fromResourcePath(location);
This fails even when location is set to the existing default shiro.ini as
either "/WEB-INF/shiro.ini" or "classpath:shiro.ini". The errors are
similar to these (running in Jetty on Windows):
java.io.FileNotFoundException: \WEB-INF\shiro.ini (The system cannot find
the path specified)
java.io.IOException: Resource [classpath:shiro.ini] could not be found.
If I specify a full path on my system
("/User/.../src/main/webapp/WEB-INF/shiro.ini"), this succeeds, but is
impractical in a deployed application. Is there some special magic I am
missing to get the classpath or something else to work properly? Or is
there a better way of reading an INI file?
I did take a look at how the IniWebEnvironment class does this, but that
does not seem to be generalizable, as implied by certain TODOs there.
(This is tangentially related to my previous question.)
Thanks.
--
View this message in context:
http://shiro-user.582556.n2.nabble.com/How-to-read-an-INI-file-on-the-classpath-tp7578796.html
Sent from the Shiro User mailing list archive at Nabble.com.