Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 42ae2c6f authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

- fix sonar warnigns

parent 7d185cbe
No related branches found
No related tags found
No related merge requests found
......@@ -7,13 +7,11 @@ import eu.europa.ec.edelivery.smp.data.ui.ServiceResult;
import eu.europa.ec.edelivery.smp.logging.SMPLogger;
import eu.europa.ec.edelivery.smp.logging.SMPLoggerFactory;
import eu.europa.ec.edelivery.smp.services.ui.UIKeystoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.KeyStore;
......@@ -69,9 +67,11 @@ public class KeystoreResource {
keyStore.load(new ByteArrayInputStream(fileBytes), password.toCharArray());
LOG.info(keyStore.aliases().nextElement());
uiKeystoreService.importKeys(keyStore,password );
uiKeystoreService.importKeys(keyStore, password);
} catch (KeyStoreException e) {
e.printStackTrace();
String msg = "KeyStoreException occurred while reading the keystore: " + e.getMessage();
LOG.error(msg, e);
keystoreImportResult.setErrorMessage(msg);
} catch (CertificateException e) {
String msg = "CertificateException occurred while reading the keystore: " + e.getMessage();
LOG.error(msg, e);
......@@ -104,7 +104,9 @@ public class KeystoreResource {
try {
uiKeystoreService.deleteKey(alias);
} catch (KeyStoreException e) {
e.printStackTrace();
String msg = "KeyStoreException occurred while reading the keystore: " + e.getMessage();
LOG.error(msg, e);
keystoreImportResult.setErrorMessage(msg);
} catch (CertificateException e) {
String msg = "CertificateException occurred while reading the keystore: " + e.getMessage();
LOG.error(msg, e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment