final Date modDate = binary.getLastModifiedDate() != null ? Date.from(binary.getLastModifiedDate()) : null; final ContentDisposition contentDisposition = ContentDisposition.type("attachment") .fileName(binary.getFilename()) .creationDate(createdDate)