@Override public Configuration getConfiguration(RepositoryFileReference ref) { Path path = this.ref2AbsolutePath(ref); PropertiesConfiguration configuration = new PropertiesConfiguration(); if (Files.exists(path)) { try (Reader r = Files.newBufferedReader(path, Charset.defaultCharset())) { configuration.read(r); } catch (ConfigurationException | IOException e) { FilebasedRepository.LOGGER.error("Could not read config file", e); throw new IllegalStateException("Could not read config file", e); } } configuration.addEventListener(ConfigurationEvent.ANY, new AutoSaveListener(path, configuration)); // We do NOT implement reloading as the configuration is only accessed // in JAX-RS resources, which are created on a per-request basis return configuration; }