private void removeAttachments(Issue issue) throws RemoveException { try { attachmentDeleteHelper.deleteAttachmentsForIssue(issue).claim(); } catch (AttachmentCleanupException e) { throw new RemoveException(e); } }
jiraServiceContext.getErrorCollection().addErrorMessage(i18n.getText("admin.errors.cannot.leave.user.groups.failed", userName, group.getName(), e.getMessage())); success = false;
errorCollection.addErrorMessage(i18nBean.getText("admin.errors.project.exception.removing", e.getMessage())); return new DeleteProjectResult(errorCollection);
@Override public boolean removeEntities(final String type, final String parameter) throws RemoveException { if (type == null) { throw new IllegalArgumentException("Type passed must not be null"); } if (parameter == null) { throw new IllegalArgumentException("Parameter passed must not be null"); } try { final List<GenericValue> entities = getEntities(type, parameter); ofBizDelegator.removeAll(entities); return true; } catch (final GenericEntityException e) { throw new RemoveException(e); } }
@Override public boolean removeEntities(final GenericValue scheme, final Long entityTypeId) throws RemoveException { if (scheme == null) { throw new IllegalArgumentException("Scheme passed to this function must not be NULL"); } try { final List<GenericValue> entities = getEntities(scheme, entityTypeId); ofBizDelegator.removeAll(entities); return true; } catch (final GenericEntityException e) { throw new RemoveException(e); } }
{ throw new RemoveException("Attachment path '" + attachmentDir + "' is not a directory"); } if (!attachmentDir.canWrite()) { throw new RemoveException("Can't write to attachment directory '" + attachmentDir + "'"); }
@Override public void removeSubTaskIssueType(String name) throws RemoveException { // Ensure that an issue type with that name exists final IssueType issueType = (IssueType) constantsManager.getIssueConstantByName(ISSUE_TYPE_NAME, name); if (issueType != null) { // Ensure that the issue type is a sub-task if (issueType.isSubTask()) { // Remove the record from the database constantsManager.removeIssueType(issueType.getId()); } else { throw new RemoveException("Issue Type with name '" + name + "' is not a sub-task issue type."); } } else { throw new RemoveException("Issue Type with name '" + name + "' does not exist."); } }
throw new RemoveException("Error removing issues: " + e, e);
@Override public void deleteAttachment(final Attachment attachment) throws RemoveException { final Issue issue = attachment.getIssue(); try { attachmentStore.deleteAttachment(attachment).claim(); ofBizDelegator.removeAll(CollectionBuilder.list(attachment.getGenericValue())); attachmentIndexManager.removeAttachmentIndex(attachment, issue); } catch (AttachmentCleanupException e) { throw new RemoveException(e); } }
@Override public void removeUserFromGroup(final Group group, final ApplicationUser userToRemove) throws PermissionException, RemoveException { validateParameters(group, userToRemove); if (crowdService.isUserDirectGroupMember(userToRemove.getDirectoryUser(), group)) { try { crowdService.removeUserFromGroup(userToRemove.getDirectoryUser(), group); } catch (OperationNotPermittedException e) { throw new PermissionException(e); } catch (OperationFailedException e) { throw new RemoveException(e); } } clearCache(); }
public void removeIssueType(String id) throws RemoveException { final IssueType issueType = getIssueType(id); if (issueType != null) { try { dbConnectionManager.execute(dbConnection -> { dbConnection.delete(ISSUE_TYPE) .where(ISSUE_TYPE.id.eq(id)) .execute(); }); } finally { refreshIssueTypes(); } } else { throw new RemoveException("Issue type with id '" + id + "' does not exist."); } }
public void deleteIssue(User user, String issueKey) throws RemoteException, RemotePermissionException { final Project project = projectManager.getProjectObjByKey(this.getIssue(user, issueKey).getProject()); if (project == null || !permissionManager.hasPermission(Permissions.DELETE_ISSUE, project, user)) { throw new RemotePermissionException("The project specified does not exist or you don't have permission to delete issues in it."); } try { final Issue issue = issueRetriever.retrieveIssue(issueKey, user).getIssue(); com.atlassian.jira.bc.issue.IssueService.DeleteValidationResult validationResult = issueService.validateDelete(user, issue.getId()); if (validationResult.isValid()) { issueService.delete(user, validationResult); } else { throw new RemoveException("Delete action executed with errors"); } } catch (Exception e) { throw new RemoteException("Unable to delete issue, cause: " + e.getMessage(), e); } }
throw new RemoveException(e);