From d93a9b9ebc4f8f638ae28e0ff4553c3126959377 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 16 Feb 2024 12:09:43 +0100 Subject: [PATCH] chargement des templates filesystem --- .../ecandidat/config/LaunchAppConfig.java | 5 +- .../controllers/CandidatureController.java | 11 +- .../controllers/CommissionController.java | 4 +- .../controllers/ConfigController.java | 99 +++++++++++++ .../ecandidat/utils/MethodUtils.java | 134 ++++++++++-------- 5 files changed, 190 insertions(+), 63 deletions(-) diff --git a/src/main/java/fr/univlorraine/ecandidat/config/LaunchAppConfig.java b/src/main/java/fr/univlorraine/ecandidat/config/LaunchAppConfig.java index 98a4a521..db90ba06 100644 --- a/src/main/java/fr/univlorraine/ecandidat/config/LaunchAppConfig.java +++ b/src/main/java/fr/univlorraine/ecandidat/config/LaunchAppConfig.java @@ -44,6 +44,7 @@ import fr.opensagres.xdocreport.template.TemplateEngineKind; import fr.univlorraine.apowsutils.WSUtils; import fr.univlorraine.ecandidat.controllers.BatchController; +import fr.univlorraine.ecandidat.controllers.ConfigController; import fr.univlorraine.ecandidat.controllers.LoadBalancingController; import fr.univlorraine.ecandidat.controllers.LockCandidatController; import fr.univlorraine.ecandidat.controllers.NomenclatureController; @@ -69,6 +70,8 @@ public class LaunchAppConfig implements ApplicationListener Optional getCasAttribute(final Map attribut * @return une ressource externe */ public static File getExternalResource(final String externalRessourceFolder, final String folderName, final String fileName) { + return getExternalResource(externalRessourceFolder, folderName + File.separator + fileName); + } + + /** + * @param externalRessourceFolder + * @param folderName + * @param fileName + * @return une ressource externe + */ + public static File getExternalResource(final String externalRessourceFolder, final String path) { try { if (StringUtils.isNotBlank(externalRessourceFolder) && !externalRessourceFolder.equals("null")) { - final File fileExternal = new File(externalRessourceFolder + folderName + File.separator + fileName); + final File fileExternal = new File(externalRessourceFolder + path); if (fileExternal.exists() && fileExternal.isFile()) { return fileExternal; }