List of usage examples for org.apache.shiro.io ResourceUtils resourceExists
public static boolean resourceExists(String resourcePath)
From source file:org.apache.activemq.shiro.env.IniEnvironment.java
License:Apache License
@Override public void init() throws ShiroException { //this.environment and this.securityManager are null. Try Ini config: Ini ini = this.ini; if (ini != null) { apply(ini);//from ww w .java 2 s. c o m } if (this.objects.isEmpty() && this.iniConfig != null) { ini = new Ini(); ini.load(this.iniConfig); apply(ini); } if (this.objects.isEmpty() && this.iniResourePath != null) { ini = new Ini(); ini.loadFromPath(this.iniResourePath); apply(ini); } if (this.objects.isEmpty()) { if (ResourceUtils.resourceExists("classpath:shiro.ini")) { ini = new Ini(); ini.loadFromPath("classpath:shiro.ini"); apply(ini); } } if (this.objects.isEmpty()) { String msg = "Configuration error. All heuristics for acquiring Shiro INI config " + "have been exhausted. Ensure you configure one of the following properties: " + "1) ini 2) iniConfig 3) iniResourcePath and the Ini sections are not empty."; throw new ConfigurationException(msg); } LifecycleUtils.init(this.objects.values()); }