diff --git a/AoU-Admin/src/main/java/ch/unige/aou/service/storage/Fedora3Client.java b/AoU-Admin/src/main/java/ch/unige/aou/service/storage/Fedora3Client.java index 288fbcf1bf5f1e56430e517469364159ee0510b2..808ad5b048aef1e9f070c605111c02aac4d1a097 100644 --- a/AoU-Admin/src/main/java/ch/unige/aou/service/storage/Fedora3Client.java +++ b/AoU-Admin/src/main/java/ch/unige/aou/service/storage/Fedora3Client.java @@ -3,8 +3,8 @@ package ch.unige.aou.service.storage; import java.io.StringReader; import java.io.StringWriter; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.nio.file.Paths; - import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; @@ -55,7 +55,7 @@ public class Fedora3Client { /** * Server Info - * + * * @return repositionInfo * @throws JAXBException */ @@ -65,7 +65,7 @@ public class Fedora3Client { /** * Next available PID - * + * * @param fedoraPrefix * @return nextPid * @throws JAXBException @@ -78,7 +78,7 @@ public class Fedora3Client { /** * Check if document exists - * + * * @param pid * @return httpStatus */ @@ -93,7 +93,7 @@ public class Fedora3Client { /** * Check if datastream exists - * + * * @param pid * @param dsId * @return httpStatus @@ -109,7 +109,7 @@ public class Fedora3Client { /** * Get document - * + * * @param pid * @return foxml document * @throws JAXBException @@ -130,7 +130,7 @@ public class Fedora3Client { /** * Ingest a new document - * + * * @param pid * @param label * @return pid @@ -141,7 +141,7 @@ public class Fedora3Client { String foxmlSting = this.convertFoxml(foxml); // Header final MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); - headers.add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_XML_VALUE); + headers.add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_XML_VALUE + ";charset=" + StandardCharsets.UTF_8.name()); final HttpEntity<String> httpEntity = new HttpEntity<>(foxmlSting, headers); try { ResponseEntity<String> response = this.restTemplate.exchange(FEDORA_OBJETS + pid, HttpMethod.POST, httpEntity, String.class); @@ -153,7 +153,7 @@ public class Fedora3Client { /** * Add XML content, ControlGroup=X - * + * * @param pid * @param dsId * @param dsLabel @@ -166,7 +166,7 @@ public class Fedora3Client { /** * Add managed content (~binary), ControlGroup=M - * + * * @param pid * @param dsId * @param dsLabel @@ -179,7 +179,7 @@ public class Fedora3Client { /** * Get datastream - * + * * @param pid * @param dsId * @return datastream info @@ -204,7 +204,7 @@ public class Fedora3Client { /** * Add a datastream - * + * * @param pid * @param dsId * @param dsGroup