@Test public void unsubscribe() throws IOException, GitAPIException { ILockedRepository repo = globalRepoManager.createProjectCentralRepository("_subscriptions", false, user); register(repo); subscriptionStore.subscribe(PROJECT, BRANCH, PAGE, user); assertTrue(subscriptionStore.isSubscribed(PROJECT, BRANCH, PAGE, user)); subscriptionStore.unsubscribe(PROJECT, BRANCH, PAGE, user); assertFalse(subscriptionStore.isSubscribed(PROJECT, BRANCH, PAGE, user)); assertClean(repo.r()); }
public void unsubscribe(String projectName, String branchName, String path, User user) throws IOException { ILockedRepository repo = null; try { repo = getOrCreateRepository(user); Set<Page> pages = getSubscriptions(user, repo); Page page = new Page(projectName, branchName, path); if (pages.remove(page)) { saveSubscriptions(user, pages, repo, true); } } catch (GitAPIException e) { throw new IOException(e); } finally { Util.closeQuietly(repo); } }
SubscriptionStore { public void unsubscribe(String projectName, String branchName, String path, User user) throws IOException { ILockedRepository repo = null; try { repo = getOrCreateRepository(user); Set<Page> pages = getSubscriptions(user, repo); Page page = new Page(projectName, branchName, path); if (pages.remove(page)) { saveSubscriptions(user, pages, repo, true); } } catch (GitAPIException e) { throw new IOException(e); } finally { Util.closeQuietly(repo); } } }
SubscriptionStore { public void unsubscribe(String projectName, String branchName, String path, User user) throws IOException { ILockedRepository repo = null; try { repo = getOrCreateRepository(user); Set<Page> pages = getSubscriptions(user, repo); Page page = new Page(projectName, branchName, path); if (pages.remove(page)) { saveSubscriptions(user, pages, repo, true); } } catch (GitAPIException e) { throw new IOException(e); } finally { Util.closeQuietly(repo); } }  }
SubscriptionStore { public void unsubscribe(String projectName, String branchName, String path, User user) throws IOException { ILockedRepository repo = null; try { repo = getOrCreateRepository(user); Set<Page> pages = getSubscriptions(user, repo); Page page = new Page(projectName, branchName, path); if (pages.remove(page)) { saveSubscriptions(user, pages, repo, true); } } catch (GitAPIException e) { throw new IOException(e); } finally { Util.closeQuietly(repo); } }  void subscribe(String projectName, String branchName, String path, User user); void unsubscribe(String projectName, String branchName, String path, User user); boolean isSubscribed(String projectName, String branchName, String path, User user); Set<String> getSubscriberEmails(String projectName, String branchName, String path); @Subscribe void renameProject(ProjectRenamedEvent event); @Subscribe void deleteProject(ProjectDeletedEvent event); @Subscribe void deleteProjectBranch(ProjectBranchDeletedEvent event); @Subscribe void renameProjectBranch(ProjectBranchRenamedEvent event); }
SubscriptionStore { public void unsubscribe(String projectName, String branchName, String path, User user) throws IOException { ILockedRepository repo = null; try { repo = getOrCreateRepository(user); Set<Page> pages = getSubscriptions(user, repo); Page page = new Page(projectName, branchName, path); if (pages.remove(page)) { saveSubscriptions(user, pages, repo, true); } } catch (GitAPIException e) { throw new IOException(e); } finally { Util.closeQuietly(repo); } }  void subscribe(String projectName, String branchName, String path, User user); void unsubscribe(String projectName, String branchName, String path, User user); boolean isSubscribed(String projectName, String branchName, String path, User user); Set<String> getSubscriberEmails(String projectName, String branchName, String path); @Subscribe void renameProject(ProjectRenamedEvent event); @Subscribe void deleteProject(ProjectDeletedEvent event); @Subscribe void deleteProjectBranch(ProjectBranchDeletedEvent event); @Subscribe void renameProjectBranch(ProjectBranchRenamedEvent event);  }