Class IniWebEnvironment

    • Constructor Detail

      • IniWebEnvironment

        public IniWebEnvironment()
    • Method Detail

      • init

        public void init()
        Initializes this instance by resolving any potential (explicit or resource-configured) Ini configuration and calling configure for actual instance configuration.
      • configure

        protected void configure()
      • getDefaultIni

        protected Ini getDefaultIni()
      • createIni

        protected Ini createIni(String configLocation,
                                boolean required)
                         throws ConfigurationException
        Creates an Ini instance reflecting the specified path, or null if the path does not exist and is not required.

        If the path is required and does not exist or is empty, a ConfigurationException will be thrown.
        Parameters:
        configLocation - the resource path to load into an Ini instance.
        required - if the path must exist and be converted to a non-empty Ini instance.
        Returns:
        an Ini instance reflecting the specified path, or null if the path does not exist and is not required.
        Throws:
        ConfigurationException - if the path is required but results in a null or empty Ini instance.
      • getDefaultConfigLocations

        protected String[] getDefaultConfigLocations()
        Returns an array with two elements, /WEB-INF/shiro.ini and classpath:shiro.ini.
        Returns:
        an array with two elements, /WEB-INF/shiro.ini and classpath:shiro.ini.
      • getIni

        public Ini getIni()
        Returns the Ini instance reflecting this WebEnvironment's configuration.
        Returns:
        the Ini instance reflecting this WebEnvironment's configuration.
      • setIni

        public void setIni(Ini ini)
        Allows for configuration via a direct Ini instance instead of via config locations.

        If the specified instance is null or empty, the fallback/default resource-based configuration will be used.
        Parameters:
        ini - the ini instance to use for creation.