From: Mathieu Baudier Date: Sat, 31 Jul 2021 15:08:04 +0000 (+0200) Subject: Fix saving of LDIF user directory. X-Git-Tag: argeo-commons-2.1.103~2 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=bf5258cc7755010580cd0141ca9087740f740174 Fix saving of LDIF user directory. --- diff --git a/org.argeo.enterprise/src/org/argeo/osgi/useradmin/LdifUserAdmin.java b/org.argeo.enterprise/src/org/argeo/osgi/useradmin/LdifUserAdmin.java index b19e9bf4f..832e8e578 100644 --- a/org.argeo.enterprise/src/org/argeo/osgi/useradmin/LdifUserAdmin.java +++ b/org.argeo.enterprise/src/org/argeo/osgi/useradmin/LdifUserAdmin.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; +import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collections; import java.util.Dictionary; @@ -106,9 +107,9 @@ public class LdifUserAdmin extends AbstractUserDirectory { throw new UserDirectoryException("Cannot save LDIF user admin: no URI is set"); if (isReadOnly()) throw new UserDirectoryException("Cannot save LDIF user admin: " + getUri() + " is read-only"); - try (FileOutputStream out = new FileOutputStream(new File(getUri()))) { + try (FileOutputStream out = new FileOutputStream(new File(new URI(getUri())))) { save(out); - } catch (IOException e) { + } catch (IOException | URISyntaxException e) { throw new UserDirectoryException("Cannot save user admin to " + getUri(), e); } }