Package org.apache.shiro.config

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


    }


    public void setDefaultFilterChainDefinitions(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


 
  @Override
  public Section getObject() throws BeansException {
    Ini ini = new Ini();
        //加载默认的url
        ini.load(filterChainDefinitions);
       
        Ini.Section section = ini.getSection(IniFilterChainResolverFactory.URLS);
        if (CollectionUtils.isEmpty(section)) {
            section = ini.getSection(Ini.DEFAULT_SECTION_NAME);
        }
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

     * @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

    try {
      LOGGER.info("Opening " + path);
      String dfsUri = fileSystem.getDefaultUri(fileSystem.getConf()).toString();
      inputStream = fileSystem.open(path);
      Ini ini = new Ini();
      ini.load(inputStream);
      return ini;
    } finally {
      if(inputStream != null) {
        try {
          inputStream.close();
View Full Code Here

    InputStream inputStream = null;
    try {
      LOGGER.info("Opening " + path);
      inputStream = fileSystem.open(path);
      Ini ini = new Ini();
      ini.load(inputStream);
      return ini;
    } finally {
      if(inputStream != null) {
        try {
          inputStream.close();
View Full Code Here

        }
    }

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

    /**
     * Returns the INI instance reflecting the specified servlet context resource path or {@code null} if no
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.