private INIFile local() { if (this.globalOnly) { throw new ConfigException(StatusCode.INVALID_LOCATION); } return this.local; }
@Test public void testConstructors() { RuntimeException parentException = new RuntimeException("message"); ConfigException exception = new ConfigException(ConfigException.StatusCode.CANNOT_WRITE); assertEquals(null, exception.getCause()); assertEquals(ConfigException.StatusCode.CANNOT_WRITE, exception.statusCode); exception = new ConfigException(parentException, ConfigException.StatusCode.CANNOT_WRITE); assertEquals(parentException, exception.getCause()); assertEquals(ConfigException.StatusCode.CANNOT_WRITE, exception.statusCode); }
private INIFile local() { if (this.globalOnly) { throw new ConfigException(StatusCode.INVALID_LOCATION); } return this.local; }
public void removeSectionGlobal(String key) { try { global.removeSection(key); } catch (NoSuchElementException e) { throw new ConfigException(e, StatusCode.MISSING_SECTION); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
@Override public File iniFile() { if (repoDirectory == null) { throw new ConfigException(StatusCode.INVALID_LOCATION); } File localConfigFile = new File(repoDirectory, "config"); return localConfigFile; } };
public Map<String, String> getAllSectionGlobal(String section) { try { return global.getSection(section); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public void removeSectionGlobal(String key) { try { global.removeSection(key); } catch (NoSuchElementException e) { throw new ConfigException(e, StatusCode.MISSING_SECTION); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public List<String> getAllSubsectionsGlobal(String section) { try { return global.listSubsections(section); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public Map<String, String> getAllGlobal() { try { return global.getAll(); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public List<String> getAllSubsectionsGlobal(String section) { try { return global.listSubsections(section); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public Map<String, String> getAllSectionGlobal(String section) { try { return global.getSection(section); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
@Override public File iniFile() { if (repoDirectory == null) { throw new ConfigException(StatusCode.INVALID_LOCATION); } File localConfigFile = new File(repoDirectory, "config"); return localConfigFile; } };
public Map<String, String> getAllGlobal() { try { return global.getAll(); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public void removeSection(String key) { try { local().removeSection(key); } catch (NoSuchElementException e) { throw new ConfigException(e, StatusCode.MISSING_SECTION); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public void removeSection(String key) { try { local().removeSection(key); } catch (NoSuchElementException e) { throw new ConfigException(e, StatusCode.MISSING_SECTION); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public Map<String, String> getAllSection(String section) { try { return local().getSection(section); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public List<String> getAllSubsections(String section) { try { return local().listSubsections(section); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public Map<String, String> getAll() { try { return local().getAll(); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public Map<String, String> getAll() { try { return local().getAll(); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }
public void removeGlobal(String key) { String[] parsed = parse(key); try { global.remove(parsed[0], parsed[1]); } catch (StringIndexOutOfBoundsException e) { throw new ConfigException(e, StatusCode.SECTION_OR_KEY_INVALID); } catch (IllegalArgumentException e) { throw new ConfigException(e, null); } catch (IOException e) { throw new ConfigException(e, null); } }