data.modMetadata = mbox.getOperationChangeID(); data.modContent  = mbox.getOperationChangeID();
data.contentChanged(mbox);
    static Document create(int id, Folder folder, String filename, String type, File content, MailItem parent) throws ServiceException {    	assert(id != Mailbox.ID_AUTO_INCREMENT);        if (folder == null || !folder.canContain(TYPE_DOCUMENT))            throw MailServiceException.CANNOT_CONTAIN();        if (content == null || content.equals(""))            throw ServiceException.INVALID_REQUEST("document may not be empty", null);        Mailbox mbox = folder.getMailbox();        UnderlyingData data = new UnderlyingData();        data.id          = id;        data.type        = TYPE_DOCUMENT;        if (parent != null)            data.parentId = parent.getId();        data.folderId    = folder.getId();        data.indexId     = id;        data.date        = mbox.getOperationTimestamp();        data.size        = (int) content.length();        data.subject     = filename;        data.metadata    = encodeMetadata(type, null);        data.modMetadata = mbox.getOperationChangeID();        data.modContent  = mbox.getOperationChangeID();        DbMailItem.create(mbox, data);        Document doc = new Document(mbox, data);        doc.finishCreation(parent);//        doc.reindex();        return doc;    }