Package net.sf.redmine_mylyn.api.model

Examples of net.sf.redmine_mylyn.api.model.Attachment


 
  @Override
  public void uploadAttachment(int issueId, String fileName, String description, AbstractTaskAttachmentSource source, String comment, IProgressMonitor monitor) throws RedmineStatusException {
    ErrrorCollector errorCollector = new ErrrorCollector();
    try {
      Attachment attachment = new Attachment();
      attachment.setFilename(fileName);
      attachment.setDescription(description);
      attachment.setFilesize(source.getLength());
      attachment.setContentType(source.getContentType());

      apiClient.uploadAttachment(issueId, attachment, source.createInputStream(monitor), comment, errorCollector, monitor);
    } catch (CoreException e) {
      new RedmineStatusException(e.getStatus());
    } catch (RedmineApiErrorException e) {
View Full Code Here


    journal.setNotes(notes);
    return journal;
  }
 
  static Attachment buildAttachment(int id, int authorId, long createdOn, String filename, int filesize, String digest, String contentType, String description) throws Exception {
    Attachment attachment = new Attachment();
    setId(attachment, id);
    attachment.setAuthorId(authorId);
    attachment.setCreatedOn(new Date(createdOn));
    attachment.setFilename(filename);
    attachment.setFilesize(filesize);
    attachment.setDigest(digest);
    attachment.setDescription(description);
    return attachment;
  }
View Full Code Here

    assertEquals(URL + "/issues/" + issue.getId() + "#note-3", attribute.getAttribute(TaskAttribute.COMMENT_URL).getValue());
   
    /* Attachments */
    /* affected by TaskAttributeMapper, RedmineTaskAttributeMapper */
    attribute = root.getAttribute(TaskAttribute.PREFIX_ATTACHMENT + "10");
    Attachment attachment = issue.getAttachments().get(10);
    assertNotNull(attribute);
    assertEquals(""+attachment.getId(), attribute.getValue());
    assertEquals(""+attachment.getAuthorId(), attribute.getAttribute(TaskAttribute.ATTACHMENT_AUTHOR).getValue());
    assertEquals(""+attachment.getCreatedOn().getTime(), attribute.getAttribute(TaskAttribute.ATTACHMENT_DATE).getValue());
    assertEquals(attachment.getFilename(), attribute.getAttribute(TaskAttribute.ATTACHMENT_FILENAME).getValue());
    assertEquals(""+attachment.getFilesize(), attribute.getAttribute(TaskAttribute.ATTACHMENT_SIZE).getValue());
    assertEquals(attachment.getDescription(), attribute.getAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION).getValue());
    assertEquals(URL + "/attachments/download/10", attribute.getAttribute(TaskAttribute.ATTACHMENT_URL).getValue());
   
    /* IssueRelations */
    /* TimeEntries + sum*/
    /* affected by TaskAttributeMapper, RedmineTaskAttributeMapper, TaskTimeEntryMapper */
 
View Full Code Here

TOP

Related Classes of net.sf.redmine_mylyn.api.model.Attachment

Copyright © 2018 www.massapicom. 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.