@Test public void testRemoveSyncRoot() throws IOException { assertNull(this.dictionary.get(PROP_ENABLED)); this.dictionary.put(PROP_SYNCROOTS, new String[] { "/virtual/old1", "/virtual/old2" }); this.serviceSettingsConsumer.removeSyncRoot(new File("/virtual/old1")); assertNull(this.dictionary.get(PROP_ENABLED)); assertArrayEquals(new String[] { "/virtual/old2" }, (String[]) this.dictionary.get(PROP_SYNCROOTS)); verify(this.configuration, times(1)).update(this.dictionary); }
protected void removeSyncRoot(final File syncRoot) throws IllegalStateException { logger.debug("removeSyncRoot(): syncRoot = {}", syncRoot); final Configuration configuration = getConfiguration(); final Dictionary<String, Object> properties = getProperties(configuration); final Set<String> syncRoots = getSyncRoots(properties); syncRoots.remove(syncRoot.getAbsolutePath()); properties.put(PROP_SYNCROOTS, syncRoots.toArray(new String[syncRoots.size()])); if (syncRoots.size() == 0) { disableSync(properties); } update(configuration, properties, null); }
ServiceSettingsConsumerImpl implements JobConsumer { protected void removeSyncRoot(final File syncRoot) throws IllegalStateException { logger.debug("removeSyncRoot(): syncRoot = {}", syncRoot); final Configuration configuration = getConfiguration(); final Dictionary<String, Object> properties = getProperties(configuration); final Set<String> syncRoots = getSyncRoots(properties); syncRoots.remove(syncRoot.getAbsolutePath()); properties.put(PROP_SYNCROOTS, syncRoots.toArray(new String[syncRoots.size()])); if (syncRoots.size() == 0) { disableSync(properties); } update(configuration, properties, null); } }
ServiceSettingsConsumerImpl implements JobConsumer { protected void removeSyncRoot(final File syncRoot) throws IllegalStateException { logger.debug("removeSyncRoot(): syncRoot = {}", syncRoot); final Configuration configuration = getConfiguration(); final Dictionary<String, Object> properties = getProperties(configuration); final Set<String> syncRoots = getSyncRoots(properties); syncRoots.remove(syncRoot.getAbsolutePath()); properties.put(PROP_SYNCROOTS, syncRoots.toArray(new String[syncRoots.size()])); if (syncRoots.size() == 0) { disableSync(properties); } update(configuration, properties, null); }  }
ServiceSettingsConsumerImpl implements JobConsumer { protected void removeSyncRoot(final File syncRoot) throws IllegalStateException { logger.debug("removeSyncRoot(): syncRoot = {}", syncRoot); final Configuration configuration = getConfiguration(); final Dictionary<String, Object> properties = getProperties(configuration); final Set<String> syncRoots = getSyncRoots(properties); syncRoots.remove(syncRoot.getAbsolutePath()); properties.put(PROP_SYNCROOTS, syncRoots.toArray(new String[syncRoots.size()])); if (syncRoots.size() == 0) { disableSync(properties); } update(configuration, properties, null); }  JobResult process(Job job); }
ServiceSettingsConsumerImpl implements JobConsumer { protected void removeSyncRoot(final File syncRoot) throws IllegalStateException { logger.debug("removeSyncRoot(): syncRoot = {}", syncRoot); final Configuration configuration = getConfiguration(); final Dictionary<String, Object> properties = getProperties(configuration); final Set<String> syncRoots = getSyncRoots(properties); syncRoots.remove(syncRoot.getAbsolutePath()); properties.put(PROP_SYNCROOTS, syncRoots.toArray(new String[syncRoots.size()])); if (syncRoots.size() == 0) { disableSync(properties); } update(configuration, properties, null); }  JobResult process(Job job);  }