use of org.dataportabilityproject.serviceProviders.common.mail.ImapMailHelper in project data-transfer-project by google.
the class MicrosoftMailService method export.
@Override
public MailModelWrapper export(ExportInformation exportInformation) throws IOException {
ImapMailHelper helper = new ImapMailHelper();
Optional<Resource> resource = exportInformation.getResource();
try {
if (resource.isPresent()) {
IdOnlyResource folder = (IdOnlyResource) resource.get();
return helper.getFolderContents(HOST, account, password, folder.getId(), getPaginationInformation(exportInformation));
} else {
return helper.getFolderContents(HOST, account, password, null, getPaginationInformation(exportInformation));
}
} catch (MessagingException e) {
throw new IOException(e);
}
}
Aggregations