Package com.taskadapter.redmineapi.bean

Examples of com.taskadapter.redmineapi.bean.Issue.addAttachment()


     * @return the created attachment object.
     */
    public Attachment addAttachmentToIssue(Integer issueId, File attachmentFile, String contentType) throws RedmineException, IOException {
        final Attachment attach = uploadAttachment(contentType, attachmentFile);
        final Issue issue = IssueFactory.create(issueId);
        issue.addAttachment(attach);
        transport.updateObject(issue);
        return attach;
    }

    /**
 
View Full Code Here


    public void uploadAttachment() throws RedmineException, IOException {
        final byte[] content = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
        final Attachment attach1 = attachmentManager.uploadAttachment("test.bin",
                "application/ternary", content);
        final Issue testIssue = IssueFactory.createWithSubject("This is upload ticket!");
        testIssue.addAttachment(attach1);
        final Issue createdIssue = issueManager.createIssue(projectKey, testIssue);
        try {
            final Collection<Attachment> attachments = createdIssue.getAttachments();
            assertThat(attachments.size()).isEqualTo(1);
            final Attachment added = attachments.iterator().next();
View Full Code Here

    final byte[] content = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
    final Attachment attach1 = attachmentManager.uploadAttachment("test.bin",
        "application/ternary", content);
    final Issue testIssue = new Issue();
    testIssue.setSubject("This is upload ticket!");
    testIssue.addAttachment(attach1);
    final Project tmpProject = ProjectFactory.create("Upload project", "uploadtmpproject");
    final Project project = mgr.getProjectManager().createProject(tmpProject);
    try {
      final Issue createdIssue = issueManager.createIssue(project.getIdentifier(),
          testIssue);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.