@Test public void testLoad() throws Exception { final Local source = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); final MonitorFolderHostCollection c = new MonitorFolderHostCollection(source); c.load(); final Host bookmark = new Host(new TestProtocol()); c.add(bookmark); assertEquals(1, c.size()); bookmark.setLabels(Collections.singleton("l")); c.collectionItemChanged(bookmark); assertEquals(1, c.size()); }
@Override public void load() throws AccessDeniedException { super.load(); if(preferences.getBoolean("bookmarks.folder.monitor")) { try { monitor.register(folder, FILE_FILTER, this); } catch(IOException e) { throw new LocalAccessDeniedException(String.format("Failure monitoring directory %s", folder.getName()), e); } } }
MonitorFolderHostCollection extends AbstractFolderHostCollection { @Override public void load() throws AccessDeniedException { super.load(); if(preferences.getBoolean("bookmarks.folder.monitor")) { try { monitor.register(folder, FILE_FILTER, this); } catch(IOException e) { throw new LocalAccessDeniedException(String.format("Failure monitoring directory %s", folder.getName()), e); } } } }
MonitorFolderHostCollection extends AbstractFolderHostCollection { @Override public void load() throws AccessDeniedException { super.load(); if(preferences.getBoolean("bookmarks.folder.monitor")) { try { monitor.register(folder, FILE_FILTER, this); } catch(IOException e) { throw new LocalAccessDeniedException(String.format("Failure monitoring directory %s", folder.getName()), e); } } } MonitorFolderHostCollection(final Local f); }
MonitorFolderHostCollection extends AbstractFolderHostCollection { @Override public void load() throws AccessDeniedException { super.load(); if(preferences.getBoolean("bookmarks.folder.monitor")) { try { monitor.register(folder, FILE_FILTER, this); } catch(IOException e) { throw new LocalAccessDeniedException(String.format("Failure monitoring directory %s", folder.getName()), e); } } } MonitorFolderHostCollection(final Local f); @Override void load(); @Override void fileWritten(final Local file); @Override void fileDeleted(final Local file); @Override void fileCreated(final Local file); }
MonitorFolderHostCollection extends AbstractFolderHostCollection { @Override public void load() throws AccessDeniedException { super.load(); if(preferences.getBoolean("bookmarks.folder.monitor")) { try { monitor.register(folder, FILE_FILTER, this); } catch(IOException e) { throw new LocalAccessDeniedException(String.format("Failure monitoring directory %s", folder.getName()), e); } } } MonitorFolderHostCollection(final Local f); @Override void load(); @Override void fileWritten(final Local file); @Override void fileDeleted(final Local file); @Override void fileCreated(final Local file);  }