diff --git a/core/src/main/java/eu/eudat/depositinterface/zenodorepository/service/ZenodoDepositServiceImpl.java b/core/src/main/java/eu/eudat/depositinterface/zenodorepository/service/ZenodoDepositServiceImpl.java index 756727e..1099919 100644 --- a/core/src/main/java/eu/eudat/depositinterface/zenodorepository/service/ZenodoDepositServiceImpl.java +++ b/core/src/main/java/eu/eudat/depositinterface/zenodorepository/service/ZenodoDepositServiceImpl.java @@ -105,7 +105,7 @@ public class ZenodoDepositServiceImpl implements ZenodoDepositService { if (links == null || !links.containsKey(ZENODO_LINKS_BUCKET)) throw new Exception("bucket not found"); String addFileUrl = links.get(ZENODO_LINKS_BUCKET) + "/" + pdfEnvelope.getFilename() + "?access_token=" + zenodoToken; - zenodoClient.put().uri(addFileUrl) + zenodoClient.put().uri(addFileUrl).headers(httpHeaders -> httpHeaders.setContentType(MediaType.APPLICATION_OCTET_STREAM)) .body(BodyInserters .fromResource(new ByteArrayResource(pdfEnvelope.getFile()))) .retrieve().toEntity(Map.class).block(); @@ -119,7 +119,7 @@ public class ZenodoDepositServiceImpl implements ZenodoDepositService { String supportingFilesZipName = dmpDepositModel.getSupportingFilesZip().getFilename(); addFileUrl = links.get(ZENODO_LINKS_BUCKET) + "/" + supportingFilesZipName + "?access_token=" + zenodoToken; - zenodoClient.put().uri(addFileUrl).body(BodyInserters.fromResource(new ByteArrayResource(supportingFilesZipName.getBytes()))).retrieve().toEntity(Map.class).block(); + zenodoClient.put().uri(addFileUrl).headers(httpHeaders -> httpHeaders.setContentType(MediaType.APPLICATION_OCTET_STREAM)).body(BodyInserters.fromResource(new ByteArrayResource(supportingFilesZipName.getBytes()))).retrieve().toEntity(Map.class).block(); } // Third post call to Zenodo to publish the entry and return the DOI.