// set Data Source
String strRes = att.getAbsolutePath();
if(!StringUtil.isEmpty(strRes)){
mbp.setDataHandler(new DataHandler(new ResourceDataSource(config.getResource(strRes))));
}
else mbp.setDataHandler(new DataHandler(new URLDataSource2(att.getURL())));
mbp.setFileName(att.getFileName());
if(!StringUtil.isEmpty(att.getType())) mbp.setHeader("Content-Type", att.getType());