@Test(expected = ExtraSectionsException.class) public void testDoParseExtraSections() { parser.doParse(getClass().getResource(EXTRA_SECTIONS_SHIRO_INI).toString()); }
@Override public Ini doParse(String raw) throws IllegalArgumentException { Ini ini; try { ini = Ini.fromResourcePath(raw); } catch (ConfigurationException e) { throw new ShiroConfigurationException(e); } Set<String> presentSections = ImmutableSortedSet.copyOf(ini.getSectionNames()); if (presentSections.isEmpty()) { throw new MissingSectionsException(); } Set<String> extraSections = Sets.difference(presentSections, ALLOWED_SECTION_NAMES); if (!extraSections.isEmpty()) { throw new ExtraSectionsException(extraSections); } return ini; }
ShiroIniParser extends NonParameterizedTypeParser<Ini> { @Override public Ini doParse(String raw) throws IllegalArgumentException { Ini ini; try { ini = Ini.fromResourcePath(raw); } catch (ConfigurationException e) { throw new ShiroConfigurationException(e); } Set<String> presentSections = ImmutableSortedSet.copyOf(ini.getSectionNames()); if (presentSections.isEmpty()) { throw new MissingSectionsException(); } Set<String> extraSections = Sets.difference(presentSections, ALLOWED_SECTION_NAMES); if (!extraSections.isEmpty()) { throw new ExtraSectionsException(extraSections); } return ini; } }
ShiroIniParser extends NonParameterizedTypeParser<Ini> { @Override public Ini doParse(String raw) throws IllegalArgumentException { Ini ini; try { ini = Ini.fromResourcePath(raw); } catch (ConfigurationException e) { throw new ShiroConfigurationException(e); } Set<String> presentSections = ImmutableSortedSet.copyOf(ini.getSectionNames()); if (presentSections.isEmpty()) { throw new MissingSectionsException(); } Set<String> extraSections = Sets.difference(presentSections, ALLOWED_SECTION_NAMES); if (!extraSections.isEmpty()) { throw new ExtraSectionsException(extraSections); } return ini; }  }
ShiroIniParser extends NonParameterizedTypeParser<Ini> { @Override public Ini doParse(String raw) throws IllegalArgumentException { Ini ini; try { ini = Ini.fromResourcePath(raw); } catch (ConfigurationException e) { throw new ShiroConfigurationException(e); } Set<String> presentSections = ImmutableSortedSet.copyOf(ini.getSectionNames()); if (presentSections.isEmpty()) { throw new MissingSectionsException(); } Set<String> extraSections = Sets.difference(presentSections, ALLOWED_SECTION_NAMES); if (!extraSections.isEmpty()) { throw new ExtraSectionsException(extraSections); } return ini; }  @Override Ini doParse(String raw); }
ShiroIniParser extends NonParameterizedTypeParser<Ini> { @Override public Ini doParse(String raw) throws IllegalArgumentException { Ini ini; try { ini = Ini.fromResourcePath(raw); } catch (ConfigurationException e) { throw new ShiroConfigurationException(e); } Set<String> presentSections = ImmutableSortedSet.copyOf(ini.getSectionNames()); if (presentSections.isEmpty()) { throw new MissingSectionsException(); } Set<String> extraSections = Sets.difference(presentSections, ALLOWED_SECTION_NAMES); if (!extraSections.isEmpty()) { throw new ExtraSectionsException(extraSections); } return ini; }  @Override Ini doParse(String raw);  }