protected boolean applyNullSafe(@Nonnull GHHook hook) { try { hook.delete(); return true; } catch (IOException e) { throw new GHException("Failed to delete post-commit hook", e); } } };
@Override public boolean remove(Object url) { try { String _url = ((URL)url).toExternalForm(); for (GHHook h : getHooks()) { if (h.getName().equals("web") && h.getConfig().get("url").equals(_url)) { h.delete(); return true; } } return false; } catch (IOException e) { throw new GHException("Failed to update post-commit hooks",e); } } };
private void removeExistingHook(final String callbackUrl) throws IOException { for (final GHHook hook : getRepository().getHooks()) { if (hook.isActive() && callbackUrl.equals(hook.getConfig().get("url"))) { hook.delete(); } } }
@Override public boolean remove(Object url) { try { String _url = ((URL)url).toExternalForm(); for (GHHook h : getHooks()) { if (h.getName().equals("web") && h.getConfig().get("url").equals(_url)) { h.delete(); return true; } } return false; } catch (IOException e) { throw new GHException("Failed to update post-commit hooks",e); } } };
@Override public boolean remove(Object url) { try { String _url = ((URL)url).toExternalForm(); for (GHHook h : getHooks()) { if (h.getName().equals("web") && h.getConfig().get("url").equals(_url)) { h.delete(); return true; } } return false; } catch (IOException e) { throw new GHException("Failed to update post-commit hooks",e); } } };
for (GHHook hook : org.getHooks()) { if (hook.getConfig().get("url").equals(url)) { hook.delete(); LOGGER.log(Level.INFO, "A webhook was deregistered for the organization {0}", org.getHtmlUrl());