Examples of addAttachment()


Examples of forestry.api.mail.ILetter.addAttachment()

    // Prepare the letter
    ILetter mail = new Letter(this.address, letter.getSender());
    mail.setText("Please find your order attached.");
    for (int i = 0; i < ordersToFill; i++) {
      mail.addAttachment(inventory.getStackInSlot(SLOT_TRADEGOOD).copy());
    }
    mail.addAttachments(getSurplusAttachments(ordersToFill, letter.getAttachments()));

    // Check for necessary postage
    int requiredPostage = mail.requiredPostage();
View Full Code Here

Examples of frost.messaging.frost.FrostUnsentMessageObject.addAttachment()

        if( filesTableModel.getRowCount() > 0 ) {
            for(int x=0; x < filesTableModel.getRowCount(); x++) {
                final MFAttachedFile af = (MFAttachedFile)filesTableModel.getRow(x);
                final File aChosedFile = af.getFile();
                final FileAttachment fa = new FileAttachment(aChosedFile);
                newMessage.addAttachment(fa);
            }
            newMessage.setHasFileAttachments(true);
        }
        if( boardsTableModel.getRowCount() > 0 ) {
            for(int x=0; x < boardsTableModel.getRowCount(); x++) {
View Full Code Here

Examples of frost.messaging.frost.FrostUnsentMessageObject.addAttachment()

        if( boardsTableModel.getRowCount() > 0 ) {
            for(int x=0; x < boardsTableModel.getRowCount(); x++) {
                final MFAttachedBoard ab = (MFAttachedBoard)boardsTableModel.getRow(x);
                final Board aChosedBoard = ab.getBoardObject();
                final BoardAttachment ba = new BoardAttachment(aChosedBoard);
                newMessage.addAttachment(ba);
            }
            newMessage.setHasBoardAttachments(true);
        }

        Identity recipient = null;
View Full Code Here

Examples of javax.jbi.messaging.NormalizedMessage.addAttachment()

        me.setMessage(in, "in");
        if (forwardAttachments) {
            Set names = srcMessage.getAttachmentNames();
            for (Iterator iter = names.iterator(); iter.hasNext();) {
                String name = (String) iter.next();
                in.addAttachment(name, srcMessage.getAttachment(name));
            }
        }
        if (forwardProperties) {
            Set names  = srcMessage.getPropertyNames();
            for (Iterator iter = names.iterator(); iter.hasNext();) {
View Full Code Here

Examples of lineage2.gameserver.model.mail.Mail.addAttachment()

          mail.setBody(StringHolder.getInstance().getNotNull(activeChar, "birthday.text"));
          ItemInstance item = ItemFunctions.createItem(21169);
          item.setLocation(ItemInstance.ItemLocation.MAIL);
          item.setCount(1L);
          item.save();
          mail.addAttachment(item);
          mail.setUnread(true);
          mail.setType(Mail.SenderType.BIRTHDAY);
          mail.setExpireTime((720 * 3600) + (int) (System.currentTimeMillis() / 1000L));
          mail.save();
          activeChar.setVar(Player.MY_BIRTHDAY_RECEIVE_YEAR, String.valueOf(now.get(Calendar.YEAR)), -1);
View Full Code Here

Examples of mage.game.permanent.Permanent.addAttachment()

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      return permanent.addAttachment(source.getSourceId(), game);
    }
    return false;
  }

}
View Full Code Here

Examples of mage.players.Player.addAttachment()

            return permanent.addAttachment(source.getSourceId(), game);
        }
        else {
            Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
            if (player != null) {
                return player.addAttachment(source.getSourceId(), game);
            }
        }
        return false;
    }
View Full Code Here

Examples of net.sourceforge.stripes.examples.bugzooky.biz.Bug.addAttachment()

            byte[] data = new byte[(int) this.newAttachment.getSize()];
            InputStream in = this.newAttachment.getInputStream();
            in.read(data);
            attachment.setData(data);
            newBug.addAttachment(attachment);
        }

        bm.saveOrUpdate(newBug);

        return new RedirectResolution("/bugzooky/BugList.jsp");
View Full Code Here

Examples of org.apache.axis2.context.MessageContext.addAttachment()

    }
   
    // Regression test for SYNAPSE-309
    public void testClonePartiallyWithAttachments() throws Exception {
        MessageContext origMc = new MessageContext();
        String contentId = origMc.addAttachment(new DataHandler("test", "text/html"));
        MessageContext newMc = MessageHelper.clonePartially(origMc);
        DataHandler dh = newMc.getAttachment(contentId);
        assertNotNull(dh);
        assertEquals("test", dh.getContent());
    }
View Full Code Here

Examples of org.apache.axis2.context.MessageContext.addAttachment()

        OMElement response = factory.createOMElement("response", ns);
        OMElement imageId  = factory.createOMElement("imageId", ns);

        FileDataSource fileDataSource = new FileDataSource(tempFile);
        dataHandler = new DataHandler(fileDataSource);
        imageContentId = outMsgCtx.addAttachment(dataHandler);
        imageId.setText(imageContentId);
        response.addChild(imageId);
        payload.addChild(response);

        return payload;
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.