This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new 05b5980029 Fixing after dependency cleanup
05b5980029 is described below

commit 05b59800292ce9547a6a4915fdaa20e9dfa3d945
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Tue May 12 10:03:51 2026 +0200

    Fixing after dependency cleanup
---
 .../syncope/core/rest/cxf/service/MailTemplateServiceImpl.java      | 6 ++----
 .../org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java   | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git 
a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/MailTemplateServiceImpl.java
 
b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/MailTemplateServiceImpl.java
index c1859b681b..e43bde1a8d 100644
--- 
a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/MailTemplateServiceImpl.java
+++ 
b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/MailTemplateServiceImpl.java
@@ -21,12 +21,10 @@ package org.apache.syncope.core.rest.cxf.service;
 import jakarta.ws.rs.InternalServerErrorException;
 import jakarta.ws.rs.core.Response;
 import jakarta.ws.rs.core.StreamingOutput;
-import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
-import org.apache.commons.io.IOUtils;
 import org.apache.syncope.common.lib.to.MailTemplateTO;
 import org.apache.syncope.common.lib.types.MailTemplateFormat;
 import org.apache.syncope.common.rest.api.RESTHeaders;
@@ -78,8 +76,8 @@ public class MailTemplateServiceImpl extends AbstractService 
implements MailTemp
     @Override
     public void setFormat(final String key, final MailTemplateFormat format, 
final InputStream templateIn) {
         try {
-            logic.setFormat(key, format, IOUtils.toString(templateIn, 
StandardCharsets.UTF_8));
-        } catch (final IOException e) {
+            logic.setFormat(key, format, new String(templateIn.readAllBytes(), 
StandardCharsets.UTF_8));
+        } catch (Exception e) {
             LOG.error("While setting format {} for mail template {}", format, 
key, e);
             throw new InternalServerErrorException("Could not read entity", e);
         }
diff --git 
a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
 
b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
index 9b2c717e8a..3b4dc19d35 100644
--- 
a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
+++ 
b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/RoleServiceImpl.java
@@ -22,12 +22,10 @@ import jakarta.ws.rs.InternalServerErrorException;
 import jakarta.ws.rs.core.MediaType;
 import jakarta.ws.rs.core.Response;
 import jakarta.ws.rs.core.StreamingOutput;
-import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.nio.charset.StandardCharsets;
 import java.util.List;
-import org.apache.commons.io.IOUtils;
 import org.apache.syncope.common.lib.to.RoleTO;
 import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.service.RoleService;
@@ -83,8 +81,8 @@ public class RoleServiceImpl extends AbstractService 
implements RoleService {
     @Override
     public void setAnyLayout(final String key, final InputStream anyLayoutIn) {
         try {
-            logic.setAnyLayout(key, IOUtils.toString(anyLayoutIn, 
StandardCharsets.UTF_8.name()));
-        } catch (final IOException e) {
+            logic.setAnyLayout(key, new String(anyLayoutIn.readAllBytes(), 
StandardCharsets.UTF_8.name()));
+        } catch (Exception e) {
             LOG.error("While setting console layout info for role {}", key, e);
             throw new InternalServerErrorException("Could not read entity", e);
         }

Reply via email to