From 069c7fc39a40231ae0a549ba5f7aa68267425304 Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Mon, 9 Dec 2024 12:35:53 +0000 Subject: [PATCH] fix: solve sonar issues --- .../rmes/bauhaus_services/ConceptsCollectionService.java | 4 ++-- .../java/fr/insee/rmes/bauhaus_services/ConceptsService.java | 4 ++-- .../rmes/bauhaus_services/StampAuthorizationChecker.java | 4 +--- .../concepts/ConceptsCollectionServiceImpl.java | 2 +- .../concepts/collections/CollectionExportBuilder.java | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsCollectionService.java b/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsCollectionService.java index 4d29856cf..3d916b5cd 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsCollectionService.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsCollectionService.java @@ -14,9 +14,9 @@ public interface ConceptsCollectionService { String getCollectionMembersByID(String id) throws RmesException; - ResponseEntity getCollectionExportODT(String id, String accept, ConceptsCollectionsResources.Language lg, boolean withConcepts, HttpServletResponse response) throws RmesException; + ResponseEntity getCollectionExportODT(String id, String accept, ConceptsCollectionsResources.Language lg, boolean withConcepts, HttpServletResponse response) throws RmesException; - ResponseEntity getCollectionExportODS(String id, String accept, boolean withConcepts, HttpServletResponse response) throws RmesException; + ResponseEntity getCollectionExportODS(String id, String accept, boolean withConcepts, HttpServletResponse response) throws RmesException; void exportZipCollection(String id, String accept, HttpServletResponse response, ConceptsCollectionsResources.Language lg, String type, boolean withConcepts) throws RmesException; } diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsService.java b/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsService.java index 149b5c399..1acc7dfd4 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsService.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/ConceptsService.java @@ -39,7 +39,7 @@ public interface ConceptsService { void setConceptsValidation(String body) throws RmesException ; - ResponseEntity exportConcept(String id, String acceptHeader) throws RmesException; + ResponseEntity exportConcept(String id, String acceptHeader) throws RmesException; void exportZipConcept(String id, String acceptHeader, HttpServletResponse response, ConceptsCollectionsResources.Language lg, String type, boolean withConcepts) throws RmesException; @@ -49,7 +49,7 @@ public interface ConceptsService { void setCollectionsValidation(String body) throws RmesException ; - ResponseEntity getCollectionExport(String id, String acceptHeader) throws RmesException ; + ResponseEntity getCollectionExport(String id, String acceptHeader) throws RmesException ; String getRelatedConcepts(String id) throws RmesException; diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/StampAuthorizationChecker.java b/src/main/java/fr/insee/rmes/bauhaus_services/StampAuthorizationChecker.java index 8bda2da36..4c08bbde3 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/StampAuthorizationChecker.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/StampAuthorizationChecker.java @@ -28,12 +28,10 @@ public class StampAuthorizationChecker extends StampsRestrictionServiceImpl { private static final Logger logger = LoggerFactory.getLogger(StampAuthorizationChecker.class); public static final String CHECKING_AUTHORIZATION_ERROR_MESSAGE = "Error while checking authorization for user with stamp {} to modify or delete {}"; public static final String ERROR_AUTHORIZATION = "Error while checking authorization for user with stamp {} to modify {}"; - private final String baseInternalUri; @Autowired - public StampAuthorizationChecker(RepositoryGestion repoGestion, AuthorizeMethodDecider authorizeMethodDecider, UserProvider userProvider, @Value("${fr.insee.rmes.bauhaus.sesame.gestion.baseInternalURI}") String baseInternalUri) { + public StampAuthorizationChecker(RepositoryGestion repoGestion, AuthorizeMethodDecider authorizeMethodDecider, UserProvider userProvider) { super(repoGestion, authorizeMethodDecider, userProvider); - this.baseInternalUri = baseInternalUri; } public boolean isSeriesManagerWithStamp(String seriesId, Stamp stamp) { diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/concepts/ConceptsCollectionServiceImpl.java b/src/main/java/fr/insee/rmes/bauhaus_services/concepts/ConceptsCollectionServiceImpl.java index 6ccb4e9e5..1d7e41ce8 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/concepts/ConceptsCollectionServiceImpl.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/concepts/ConceptsCollectionServiceImpl.java @@ -89,7 +89,7 @@ public ResponseEntity getCollectionExportODT(String id, String accept, Concep String fileName = getFileNameForExport(collection, lg); if(conceptsIds.isEmpty()){ - return collectionExport.exportAsResponseODT(fileName, xmlContent,true,true,true, lg); + return collectionExport.exportAsResponseODT(fileName, xmlContent,true, lg); } Map concepts = conceptsService.getConceptsExportIS(conceptsIds, null); diff --git a/src/main/java/fr/insee/rmes/bauhaus_services/concepts/collections/CollectionExportBuilder.java b/src/main/java/fr/insee/rmes/bauhaus_services/concepts/collections/CollectionExportBuilder.java index e378e70a4..fbd5d670b 100644 --- a/src/main/java/fr/insee/rmes/bauhaus_services/concepts/collections/CollectionExportBuilder.java +++ b/src/main/java/fr/insee/rmes/bauhaus_services/concepts/collections/CollectionExportBuilder.java @@ -109,7 +109,7 @@ public ResponseEntity exportAsResponse(String fileName, Map exportAsResponseODT(String fileName, Map xmlContent, boolean lg1, boolean lg2, boolean includeEmptyFields, ConceptsCollectionsResources.Language lg) throws RmesException { + public ResponseEntity exportAsResponseODT(String fileName, Map xmlContent, boolean includeEmptyFields, ConceptsCollectionsResources.Language lg) throws RmesException { String parametersXML = XsltUtils.buildParams(true, true, includeEmptyFields, Constants.COLLECTION); xmlContent.put(Constants.PARAMETERS_FILE, parametersXML); String xmlPattern = lg == ConceptsCollectionsResources.Language.lg1 ? xmlPatternFR : xmlPatternEN;