private Optional<MDNReport> parseReport(Entity report) { LOGGER.debug("Parsing report"); try { return new MDNReportParser().parse(((SingleBody)report.getBody()).getInputStream(), report.getCharset()); } catch (IOException e) { LOGGER.error("unable to parse MESSAGE_DISPOSITION_NOTIFICATION part", e); return Optional.empty(); } }