Mercurial > dive4elements > river
changeset 9765:7a51e6321a4e 3.2.x
Avoid API that is removed in Java 11
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 12 Jan 2023 18:01:34 +0100 |
parents | b5d4cb088737 |
children | b64335345270 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java Thu Jan 12 13:11:24 2023 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java Thu Jan 12 18:01:34 2023 +0100 @@ -10,6 +10,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Base64; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; @@ -25,7 +26,6 @@ import java.io.IOException; import javax.xml.xpath.XPathConstants; -import javax.xml.bind.DatatypeConverter; import net.sf.ehcache.Cache; @@ -1163,7 +1163,7 @@ } MessageDigest md = MessageDigest.getInstance("MD5"); byte[] md5sum = md.digest(ba.toByteArray()); - return DatatypeConverter.printBase64Binary(md5sum); + return Base64.getEncoder().encodeToString(md5sum); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("MD5 unavailable. Can't happen."); } catch (IOException e) {