public Collection<Attachment> getAttachments() { return issue.getAttachments(); }
public Collection<Attachment> getAttachments() { return issue.getAttachments(); }
private boolean hasAttachments(final Issue issue) { return issue.getAttachments() != null && !issue.getAttachments().isEmpty(); }
@Override public boolean shouldDisplay(ApplicationUser applicationUser, Issue issue, JiraHelper jiraHelper) { return issue.getAttachments().size() == 0; } }
/** * Generate the attachment params for the template. * * @return Map the attachment params for the template. */ public Map<String, Object> getAttachmentParams() { Map<String, Object> attachmentParams = new HashMap<String, Object>(); attachmentParams.put("attachments", issue.getAttachments()); return attachmentParams; }
@Override public EnclosedIterable<Attachment> getAttachmentOfIssue(final @Nonnull Issue issue) { return CollectionEnclosedIterable.from(issue.getAttachments()); }
public boolean isIssueWithAttachments() { return !getIssueObject().getAttachments().isEmpty(); }
private int getAllAttachmentsCount(){ return getIssueObject().getAttachments().size(); }
private Attachment getAttachment(Issue issue, String attachementName) throws GenericEntityException { Attachment attachment = null; Collection<Attachment> attachments = issue.getAttachments(); for (final Attachment tempAttachement : attachments) { if (tempAttachement.getFilename().equals(attachementName)) { // Since the list is sorted by filename and date we know the first is the most recent attachment = tempAttachement; break; } } return attachment; }
@Override protected List<Attachment> create() throws Exception { if(!canRemoteServerRecieveAttachments()){ return Collections.emptyList(); } return ImmutableList.copyOf( Iterables.filter(getIssueObject().getAttachments(), new Predicate<Attachment>() { @Override public boolean apply(Attachment input) { return input.getFilesize() > copyInfo.getMaxAttachmentSize(); } }) ); } };
public int getNextScreenshotNumber() { int last = 0; for (final Attachment attachment : getIssueObject().getAttachments()) { final Matcher matcher = SHOT_NUMBER_REGEX.matcher(attachment.getFilename()); if (matcher.find()) { try { last = Math.max(last, Integer.parseInt(matcher.group(1))); } catch (RuntimeException impossible) { log.info("problem parsing screenshot number in " + attachment.getFilename(), impossible); } } } return last + 1; }
public int getNextScreenshotNumber() { int last = 0; for (final Attachment attachment : getIssueObject().getAttachments()) { final Matcher matcher = SHOT_NUMBER_REGEX.matcher(attachment.getFilename()); if (matcher.find()) { try { last = Math.max(last, Integer.parseInt(matcher.group(1))); } catch (RuntimeException impossible) { log.info("problem parsing screenshot number in " + attachment.getFilename(), impossible); } } } return last + 1; }
protected void validateAttachmentMove() { Collection attachments = getIssueObject().getAttachments(); if (!hasProjectPermission(ProjectPermissions.CREATE_ATTACHMENTS, getTargetProjectObj()) && !attachments.isEmpty()) { addErrorMessage(getText("moveissue.create.attachment.permission")); } }
public RendererAttachment getAttachment(RenderContext context, EmbeddedResource resource) { // Make sure we have an issue and a usable issueGV from the issue Issue issue = (Issue) context.getParam(AtlassianWikiRenderer.ISSUE_CONTEXT_KEY); if (resource.isInternal() && issue == null || issue.getGenericValue() == null) { log.debug("No usable issue stored in the context, unable to resolve filename '" + resource.getFilename() + "'"); throw new RuntimeException("No usable issue stored in the context, unable to resolve filename '" + resource.getFilename() + "'"); } Attachment attachment = null; Collection<Attachment> attachments; attachments = issue.getAttachments(); for (final Attachment tempAttachement : attachments) { if (tempAttachement.getFilename().equals(resource.getFilename())) { // Since the list is sorted by filename and date we know the first is the most recent attachment = tempAttachement; break; } } if (attachment == null) { return null; } else { return convertToRendererAttachment(attachment, context, resource); } }