Examples of Attachment


Examples of br.eti.kinoshita.testlinkjavaapi.model.Attachment

    /**
     * @param map
     * @return Attachment.
     */
    public static final Attachment getAttachment(Map<String, Object> map) {
        Attachment attachment = null;
        if (map != null && map.size() > 0) {
            Object o = map.get(TestLinkResponseParams.ID.toString());
            if (o != null) {
                Integer id = Integer.parseInt(o.toString());

                if (id > 0) {
                    attachment = new Attachment();
                    attachment.setId(id);

                    attachment.setFileName(getString(map, TestLinkResponseParams.NAME.toString()));
                    attachment.setFileType(getString(map, TestLinkResponseParams.FILE_TYPE.toString()));
                    attachment.setTitle(getString(map, TestLinkResponseParams.TITLE.toString()));
                    // TBD: put the date too...
                    attachment.setContent(getString(map, TestLinkResponseParams.CONTENT.toString()));
                    // TBD: description not beign returned
                    // attachment.setDescription( getString(map,
                    // TestLinkResponseParams.description.toString() ) );
                    // TBD: returning name instead of file_name
                    // TBD: file size not beign returned

Examples of com.apress.prospring.domain.Attachment

public class AttachmentController extends MultiActionController {

  private BlogManager blogManager;

  public ModelAndView handleDownload(HttpServletRequest request, HttpServletResponse response) throws Exception {
    Attachment attachment = blogManager.getAttachment(RequestUtils.getRequiredIntParameter(request, "attachmentId"));

    response.setContentType(attachment.getContentType());
    response.addHeader("Content-disposition", "attachment; filename=" + attachment.getFileName());
    response.getOutputStream().write(attachment.getFileData());

    return null;
  }

Examples of com.aspose.email.Attachment

MailMessage message = MailMessage.load("data/message.msg", MessageFormat.getMsg());

System.out.println("Extracting attachments....");
for (int i = 0; i < message.getAttachments().size(); i++)
{
    Attachment att = (Attachment) message.getAttachments().get_Item(i);
    System.out.println("Attachment Name: " + att.getName());

    // Get the name of attachment. If msg subject contains characters like :, /, \ etc., replace with space
    // because windows cannot save files with these characters
    // also save first 50 characters as file name to avoid long file names
    String attFileName = att.getName().replace(".eml", "").replace(":", " ").replace("\\", " ").replace("/", " ").replace("?", "");
    if (attFileName.length() > 50)
    {
        attFileName = attFileName.substring(0, 50);
    }

    // Save the attachment to disk
    att.save("data/" + attFileName);
}
      System.out.println("Done ...");
  }

Examples of com.atlassian.jira.rest.client.api.domain.Attachment

    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());

    // attachments
    final Iterable<Attachment> attachments = issue.getAttachments();
    assertEquals(7, Iterables.size(attachments));
    final Attachment attachment = findAttachmentByFileName(attachments, "avatar1.png");
    assertEquals(TestConstants.USER_ADMIN_BASIC, attachment.getAuthor());
    assertEquals(359345, attachment.getSize());
    assertEquals(toUri("http://localhost:8090/jira/secure/thumbnail/10070/_thumb_10070.png"), attachment.getThumbnailUri());
    assertEquals(toUri("http://localhost:8090/jira/secure/attachment/10070/avatar1.png"), attachment.getContentUri());
    final Iterable<String> attachmentsNames = EntityHelper.toFileNamesList(attachments);
    assertThat(attachmentsNames, containsInAnyOrder("10000_thumb_snipe.jpg", "Admal pompa ciepła.pdf",
        "apache-tomcat-5.5.30.zip", "avatar1.png", "jira_logo.gif", "snipe.png", "transparent-png.png"));

    // worklogs

Examples of com.atlassian.jira.rest.client.domain.Attachment

    final int size = json.getInt("size");
    final String mimeType = json.getString("mimeType");
    final URI contentURI = JsonParseUtil.parseURI(json.getString("content"));
    final URI thumbnailURI = JsonParseUtil.parseOptionalURI(json, THUMBNAIL);
        final Long id = JsonParseUtil.getOptionalLong(json, "id");
    return new Attachment(selfUri, id, filename, author, creationDate, size, mimeType, contentURI, thumbnailURI);
  }

Examples of com.caucho.util.Attachment

      in = getXMLInputFactory().createXMLStreamReader(is);
      out = getXMLOutputFactory().createXMLStreamWriter(domResult);
    }
    else if (attachments != null && attachments.size() > 0) {
      Attachment body = attachments.get(0);
      ByteArrayInputStream bais = new ByteArrayInputStream(body.getContents());

      in = getXMLInputFactory().createXMLStreamReader(bais);
      out = getXMLOutputFactory().createXMLStreamWriter(os);
    }
    else {

Examples of com.centraview.email.Attachment

          if (attachments != null)
          {
            Iterator attachmentIterator = attachments.iterator();
            while (attachmentIterator.hasNext())
            {
              Attachment attachment = (Attachment)attachmentIterator.next();
              newAttachments.put(Integer.toString(attachment.getFileID()), attachment.getFilename());
            } //end of while loop (attachmentIterator.hasNext())
          } //end of if statement (attachments != null)

          newEventHashMap.put("Attachment", newAttachments);

Examples of com.cloud.network.bigswitch.Attachment

        port.setTenant_id(cmd.getTenantUuid());

        try {
            _bigswitchVnsApi.createPort(cmd.getNetworkUuid(), port);
            try {
                Attachment attachment = new Attachment();
                attachment.setId(cmd.getPortUuid());
                attachment.setMac(cmd.getMac());
                _bigswitchVnsApi.modifyPortAttachment(cmd.getTenantUuid(),
                                cmd.getNetworkUuid(), cmd.getPortUuid(), attachment);

            } catch (BigSwitchVnsApiException ex) {
                s_logger.warn("modifyPortAttachment failed after switchport was created, removing switchport");

Examples of com.ecyrd.jspwiki.attachment.Attachment

    private void refreshBlacklists( WikiContext context )
    {
        try
        {
            WikiPage source = context.getEngine().getPage( m_forbiddenWordsPage );
            Attachment att = context.getEngine().getAttachmentManager().getAttachmentInfo( context, m_blacklist );

            boolean rebuild = false;

            //
            //  Rebuild, if the page or the attachment has changed since.
            //
            if( source != null )
            {
                if( m_spamPatterns == null || m_spamPatterns.isEmpty() || source.getLastModified().after(m_lastRebuild) )
                {
                    rebuild = true;
                }
            }

            if( att != null )
            {
                if( m_spamPatterns == null || m_spamPatterns.isEmpty() || att.getLastModified().after(m_lastRebuild) )
                {
                    rebuild = true;
                }
            }

Examples of com.esotericsoftware.spine.attachments.Attachment

  /** @return May be null. */
  public Attachment getAttachment (int slotIndex, String attachmentName) {
    if (attachmentName == null) throw new IllegalArgumentException("attachmentName cannot be null.");
    if (skin != null) {
      Attachment attachment = skin.getAttachment(slotIndex, attachmentName);
      if (attachment != null) return attachment;
    }
    if (data.defaultSkin != null) return data.defaultSkin.getAttachment(slotIndex, attachmentName);
    return null;
  }
TOP
Copyright © 2015 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.