Package com.elasticinbox.core.model

Examples of com.elasticinbox.core.model.Message


    byte[] response;
    Map<String, Object> result = new HashMap<String, Object>(3);

    try {
      Message message = messageDAO.getParsed(mailbox, messageId);
      result.put("message", message);

      // automatically mark as seen if requested and not seen yet
      if (markAsSeen && !message.getMarkers().contains(Marker.SEEN))
      {
        messageDAO.modify(mailbox, messageId,
            new MessageModification.Builder().addMarker(Marker.SEEN).build());
      }
View Full Code Here


  {
    Mailbox mailbox = new Mailbox(user, domain);
    URI uri = null;

    try {
      Message message = messageDAO.getParsed(mailbox, messageId);
      uri = message.getLocation();
      Assert.notNull(uri, "No source message");
    } catch (IllegalArgumentException iae) {
      throw new BadRequestException(iae.getMessage());
    } catch (Exception e) {
      logger.warn("Internal Server Error: ", e);
View Full Code Here

    // generate new UUID
    UUID newMessageId = new MessageIdBuilder().build();

    try {
      Message oldMessage = messageDAO.getParsed(mailbox, messageId);

      FileInputStream in = new FileInputStream(file);
      MimeParser parser = new MimeParser();

      // parse message
      parser.parse(in);
      Message newMessage = parser.getMessage();
      newMessage.setSize(file.length()); // update message size
      in.close();

      // add labels to message
      for(Integer label : oldMessage.getLabels()) {
        newMessage.addLabel(label);
      }

      // add markers to message
      for(Marker marker : oldMessage.getMarkers()) {
        newMessage.addMarker(marker);
      }

      // store message
      in = new FileInputStream(file);
      messageDAO.put(mailbox, newMessageId, newMessage, in);
View Full Code Here

TOP

Related Classes of com.elasticinbox.core.model.Message

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.