Package org.apache.shiro.config

Examples of org.apache.shiro.config.Ini.load()


        String path = WebUtils.normalize(servletContextPath);
        if (getServletContext() != null) {
            InputStream is = getServletContext().getResourceAsStream(path);
            if (is != null) {
                Ini ini = new Ini();
                ini.load(is);
                if (CollectionUtils.isEmpty(ini)) {
                    log.warn("ServletContext INI resource '" + servletContextPath + "' exists, but it did not contain " +
                            "any data.");
                }
                return ini;
View Full Code Here


                    }
                }
            }
            if (is != null) {
                ini = new Ini();
                ini.load(is);
            } else {
                if (required) {
                    throw new ConfigurationException("Unable to load resource path '" + path + "'");
                }
            }
View Full Code Here

     * @param definitions a {@link java.util.Properties Properties}-compatible string (multi-line key/value pairs)
     *                    where each key/value pair represents a single urlPathExpression-commaDelimitedChainDefinition.
     */
    public void setFilterChainDefinitions(String definitions) {
        Ini ini = new Ini();
        ini.load(definitions);
        //did they explicitly state a 'urls' section?  Not necessary, but just in case:
        Ini.Section section = ini.getSection(IniFilterChainResolverFactory.URLS);
        if (CollectionUtils.isEmpty(section)) {
            //no urls section.  Since this _is_ a urls chain definition property, just assume the
            //default section contains only the definitions:
View Full Code Here

        }
    }

    protected Ini convertConfigToIni(String config) {
        Ini ini = new Ini();
        ini.load(config);
        return ini;
    }

    protected Ini convertPathToIni(String path) {
        Ini ini = new Ini();
View Full Code Here

    public void testNewInstanceWithIni() {
        Ini ini = new Ini();
        String config =
                "[urls]\n" +
                        "/index.html = anon";
        ini.load(config);
        factory = new IniFilterChainResolverFactory(ini);
        FilterChainResolver resolver = factory.getInstance();
        assertNotNull(resolver);
    }
View Full Code Here

        String config =
                "[filters]\n" +
                        "test = org.apache.shiro.web.servlet.SimpleCookie\n" + //any non-Filter will do
                        "[urls]\n" +
                        "/index.html = anon";
        ini.load(config);
        factory = new IniFilterChainResolverFactory(ini);
        factory.getInstance();
    }

    @Test
View Full Code Here

    public void testNewInstanceWithFilterConfig() {
        Ini ini = new Ini();
        String text =
                "[urls]\n" +
                        "/index.html = anon";
        ini.load(text);
        factory = new IniFilterChainResolverFactory(ini);
        FilterConfig config = createNiceMockFilterConfig();
        factory.setFilterConfig(config);
        replay(config);
        FilterChainResolver resolver = factory.getInstance();
View Full Code Here

  @PostConstruct
  public void postConstruct() throws ConfigurationException, IOException {
    URL iniURL = getShiroIniURL();
    if (iniURL != null) {
      Ini ini = new Ini();
      ini.load(iniURL.openStream());
      IniSecurityManagerFactory factory = new IniSecurityManagerFactory(ini);
      manager = factory.getInstance();
    }
  }
View Full Code Here

        init();
    }

    public IniEnvironment(String iniConfig) {
        Ini ini = new Ini();
        ini.load(iniConfig);
        this.ini = ini;
        init();
    }

    public void setIni(Ini ini) {
View Full Code Here

            apply(ini);
        }

        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();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.