Skip to content

Commit 6401604

Browse files
committed
debug les entrées de fichiers externes
1 parent 737cb15 commit 6401604

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

src/main/java/fr/univlorraine/ecandidat/config/LaunchAppConfig.java

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import java.io.IOException;
2222
import java.io.InputStream;
2323
import java.lang.reflect.Field;
24+
import java.nio.file.Files;
25+
import java.nio.file.Paths;
2426
import java.util.List;
2527

2628
import javax.annotation.Resource;
@@ -110,7 +112,7 @@ public void onApplicationEvent(final ContextRefreshedEvent event) {
110112
preprocessNomenclature();
111113
preprocessTemplate();
112114
preprocessAnnotations();
113-
preprocessConfigUrlServicesLocation();
115+
preprocessExternalRessource();
114116
preprocessCache();
115117
preprocessVersions();
116118
}
@@ -219,12 +221,13 @@ private void changeAnnotationAdresse(final String fieldName, final int size) thr
219221
/**
220222
* Charge les évenuelles infos pour les WS Apogée --> localisation du repertoire des fichiers SiScol et headers du fichier properties
221223
*/
222-
private void preprocessConfigUrlServicesLocation() {
224+
private void preprocessExternalRessource() {
225+
/* Charge les évenuelles infos pour les WS Apogée --> localisation du repertoire des fichiers SiScol */
223226
try {
224227
if (StringUtils.isNotBlank(externalRessource)) {
225228
/* Localisation des fichiers d'url */
226229
final String path = externalRessource + ConstanteUtils.EXTERNAL_RESSOURCE_SISCOL_FOLDER + File.separator;
227-
logger.info("Definition repertoire des fichiers d'URL Siscol : " + path);
230+
logger.debug("Definition repertoire des fichiers d'URL Siscol : " + path);
228231
WSUtils.setPropertyFilePath(path);
229232
//System.setProperty(WSUtils.PROPERTY_FILE_PATH, path);
230233
// final File fileExternal = new File(path);
@@ -233,17 +236,33 @@ private void preprocessConfigUrlServicesLocation() {
233236
// System.setProperty(WSUtils.PROPERTY_FILE_PATH, path);
234237
// }
235238
}
236-
/* On tente d'ajouter les headers de services eventuellement contenus dans le fichier de properties
237-
* (on peut aussi les ajouter directement dans le fichierconfigUrlServices) */
238-
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_ETUDIANT_METIER, wsApogeeHeaderEtudiantMetier);
239-
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_PEDAGOGIQUE_METIER, wsApogeeHeaderPedagogiqueMetier);
240-
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_OPI_METIER, wsApogeeHeaderOpiMetier);
241-
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_PJ_OPI_METIER, wsApogeeHeaderPjOpiMetier);
242-
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_PJ, wsApogeeHeaderPj);
243-
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_CHECKINES, wsApogeeHeaderCheckInes);
239+
} catch (final Exception e) {
240+
}
241+
242+
/* Charge les évenuelles infos pour les WS Apogée --> On tente d'ajouter les headers de services eventuellement
243+
* contenus dans le fichier de properties (on peut aussi les ajouter directement dans le fichierconfigUrlServices) */
244+
try {
245+
if (StringUtils.isNotBlank(externalRessource)) {
246+
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_ETUDIANT_METIER, wsApogeeHeaderEtudiantMetier);
247+
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_PEDAGOGIQUE_METIER, wsApogeeHeaderPedagogiqueMetier);
248+
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_OPI_METIER, wsApogeeHeaderOpiMetier);
249+
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_PJ_OPI_METIER, wsApogeeHeaderPjOpiMetier);
250+
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_PJ, wsApogeeHeaderPj);
251+
addWsApoHeader(ConstanteUtils.WS_APOGEE_SERVICE_CHECKINES, wsApogeeHeaderCheckInes);
252+
}
253+
} catch (final Exception e) {
254+
}
244255

256+
/* Listing des ressources externes */
257+
try {
258+
if (StringUtils.isNotBlank(externalRessource)) {
259+
Files.walk(Paths.get(externalRessource))
260+
.filter(p -> Files.isRegularFile(p))
261+
.forEach(e -> logger.debug("Ajout du fichier de ressources : " + e.toAbsolutePath()));
262+
}
245263
} catch (final Exception e) {
246264
}
265+
247266
}
248267

249268
/**

0 commit comments

Comments
 (0)