Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
George Kalampokis | a0150f8c0f | |
George Kalampokis | 3b40f31cd0 |
|
@ -88,7 +88,7 @@ public class ZenodoDeposit implements RepositoryDeposit {
|
|||
logger.debug(objectMapper.writeValueAsString(createResponse));
|
||||
links = (LinkedHashMap<String, String>) createResponse.get("links");
|
||||
//Second, make the new version (not in the links?)
|
||||
String newVersionUrl = links.get("self") + "/actions/newversion" + "?access_token=" + zenodoToken;
|
||||
String newVersionUrl = links.get("latest_draft") + "/actions/newversion" + "?access_token=" + zenodoToken;
|
||||
logger.debug("new version url: " + newVersionUrl);
|
||||
createResponse = restTemplate.postForObject(newVersionUrl, null, Map.class);
|
||||
logger.debug("createResponse-newVersion:");
|
||||
|
@ -129,7 +129,9 @@ public class ZenodoDeposit implements RepositoryDeposit {
|
|||
// Second step, add the file to the entry.
|
||||
FileEnvelope pdfEnvelope = dmpDepositModel.getPdfFile();
|
||||
FileSystemResource fileSystemResource = new FileSystemResource(pdfEnvelope.getFile());
|
||||
HttpEntity<FileSystemResource> addFileMapRequest = new HttpEntity<>(fileSystemResource, null);
|
||||
HttpHeaders fileHeaders = new HttpHeaders();
|
||||
fileHeaders.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
HttpEntity<FileSystemResource> addFileMapRequest = new HttpEntity<>(fileSystemResource, fileHeaders);
|
||||
|
||||
String addFileUrl = links.get("bucket") + "/" + pdfEnvelope.getFilename() + "?access_token=" + zenodoToken;
|
||||
restTemplate.put(addFileUrl, addFileMapRequest);
|
||||
|
|
Loading…
Reference in New Issue