package _VisualDVM.Repository;
import Common.Utils.Utils_;

import java.io.File;
import java.io.Serializable;
import java.util.LinkedHashMap;
public class EmailMessage implements Serializable {
    public String subject = ""; //тема письма
    public String text = ""; //текст письма
    public LinkedHashMap<String, byte[]> files = new LinkedHashMap<>(); //вложения.
    public EmailMessage() {
    }
    public EmailMessage(String subject_in, String text_in) {
        subject = subject_in;
        text = text_in;
    }
    public EmailMessage(EmailMessage message_in) {
        subject = message_in.subject;
        text = message_in.text;
        files.putAll(message_in.files);
    }
    public void addAttachement(File f) throws Exception {
        files.put(f.getName(), Utils_.fileToBytes(f));
    }
}
