diff --git a/smp-parent-pom/pom.xml b/smp-parent-pom/pom.xml index d2ca8eeef06ea9814395c85510a86626b0caf5be..9ba6f24377d67bb792217be4716ef2a0c44362be 100644 --- a/smp-parent-pom/pom.xml +++ b/smp-parent-pom/pom.xml @@ -99,10 +99,8 @@ <!-- jacoco, sonar code coverage settings start --> <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> - <sonar.jacoco.reportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-ut.exec - </sonar.jacoco.reportPath> - <sonar.jacoco.itReportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-it.exec - </sonar.jacoco.itReportPath> + <sonar.jacoco.reportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath> + <sonar.jacoco.itReportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath> <sonar.language>java</sonar.language> diff --git a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIKeystoreService.java b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIKeystoreService.java index 38f2646b563e3faebfdfcd447f399dd315a8606b..3b3f365845fee6956a03925d0eb6cd1dcfefae70 100644 --- a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIKeystoreService.java +++ b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIKeystoreService.java @@ -76,14 +76,12 @@ public class UIKeystoreService { public void refreshData() { - LOG.info("initialize from configuration folder:" + configurationDir - + ", enc file: " + encryptionFilename + ", keystore " + smpKeyStoreFilename); + LOG.info("initialize from configuration folder:{}, enc file: {}, keystore {}" , configurationDir, encryptionFilename, smpKeyStoreFilename); if (configurationDir == null || encryptionFilename == null) { LOG.warn("Configuration folder and/or encryption filename are not set in database!"); return; } - String encFilePath = configurationDir + File.separator + encryptionFilename; File file = new File(configurationDir + File.separator + encryptionFilename); File keystoreFilePath = new File(configurationDir + File.separator + smpKeyStoreFilename); if (!file.exists()) { @@ -215,7 +213,6 @@ public class UIKeystoreService { public void deleteKey(String alias) throws NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException { KeyStore keyStore = loadKeystore(); - keyStore.deleteEntry(alias); if (keyStore != null) { keyStore.deleteEntry(alias); // store keystore diff --git a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/config/SmpWebAppConfig.java b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/config/SmpWebAppConfig.java index 264e8594cb367741037c4a1a60584344e2976b2e..f9d35066613d5c183fb418a696d5ef432404f1e8 100644 --- a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/config/SmpWebAppConfig.java +++ b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/config/SmpWebAppConfig.java @@ -13,27 +13,16 @@ package eu.europa.ec.edelivery.smp.config; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; import eu.europa.ec.edelivery.smp.error.ErrorMappingControllerAdvice; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Primary; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.util.UrlPathHelper; -import java.util.List; - import static org.springframework.core.Ordered.HIGHEST_PRECEDENCE; /** @@ -56,9 +45,9 @@ public class SmpWebAppConfig implements WebMvcConfigurer { registry.setOrder(HIGHEST_PRECEDENCE) .addResourceHandler("/index.html", "/favicon-16x16.png").addResourceLocations("/static_resources/"); - registry.setOrder(HIGHEST_PRECEDENCE-2) + registry.setOrder(HIGHEST_PRECEDENCE - 2) .addResourceHandler("/ui/rest/").addResourceLocations("/"); // ui rest resources - registry.setOrder(HIGHEST_PRECEDENCE-3) + registry.setOrder(HIGHEST_PRECEDENCE - 3) .addResourceHandler("/ui/**").addResourceLocations("/ui/"); // angular pages } @@ -68,18 +57,11 @@ public class SmpWebAppConfig implements WebMvcConfigurer { configurer.setUseSuffixPatternMatch(false); // do not decode path before mapping - that cause problems to identifiers with / - UrlPathHelper urlPathHelper =configurer.getUrlPathHelper(); - if (urlPathHelper==null) { + UrlPathHelper urlPathHelper = configurer.getUrlPathHelper(); + if (urlPathHelper == null) { urlPathHelper = new UrlPathHelper(); configurer.setUrlPathHelper(urlPathHelper); } urlPathHelper.setUrlDecode(false); } - - @Bean - public CommonsMultipartResolver multipartResolver(){ - CommonsMultipartResolver resolver = new CommonsMultipartResolver(); - resolver.setMaxUploadSize(10*1024*1024); // set the size limit - return resolver; - } }