// Load the file
Document d_tmp;
try {
d_tmp = UtlXML.load_file(f);
} catch (Exception ex) {
throw new MessageXMLException("Cannot load file", ex);
}
Element e_tmp = (Element) d_tmp.getChildNodes().item(0);
// Import the loaded element to the document
Element e = (Element) d.importNode(e_tmp, true);
// Initialize
this.setElement(e);
this.co = co;
// Set the From address to the contact name
String addressfrom = this.getContactFrom();
String contact;
try {
contact = this.co.getContactsXML().getNameByEmail(addressfrom);
} catch (Exception ex) {
throw new MessageXMLException("Cannot get contact name for address "+addressfrom, ex);
}
this.setFrom(contact);
// Validate address
String md_from = md.getContactFrom();
if (!addressfrom.equals(md_from))
throw new MessageXMLException("Incoherent sender: "+addressfrom+" and "+md_from);
// Add the marian pau file, if exists
if (md.getAttatchment() != null)
this.setParameter(MessageXML.Parameter.attachment.name(), md.getAttatchment());
// Adjust the status
if (this.getPieceSet().length() > 0)