21
21
import java .io .IOException ;
22
22
import java .io .InputStream ;
23
23
import java .lang .reflect .Field ;
24
+ import java .nio .file .Files ;
25
+ import java .nio .file .Paths ;
24
26
import java .util .List ;
25
27
26
28
import javax .annotation .Resource ;
@@ -110,7 +112,7 @@ public void onApplicationEvent(final ContextRefreshedEvent event) {
110
112
preprocessNomenclature ();
111
113
preprocessTemplate ();
112
114
preprocessAnnotations ();
113
- preprocessConfigUrlServicesLocation ();
115
+ preprocessExternalRessource ();
114
116
preprocessCache ();
115
117
preprocessVersions ();
116
118
}
@@ -219,12 +221,13 @@ private void changeAnnotationAdresse(final String fieldName, final int size) thr
219
221
/**
220
222
* Charge les évenuelles infos pour les WS Apogée --> localisation du repertoire des fichiers SiScol et headers du fichier properties
221
223
*/
222
- private void preprocessConfigUrlServicesLocation () {
224
+ private void preprocessExternalRessource () {
225
+ /* Charge les évenuelles infos pour les WS Apogée --> localisation du repertoire des fichiers SiScol */
223
226
try {
224
227
if (StringUtils .isNotBlank (externalRessource )) {
225
228
/* Localisation des fichiers d'url */
226
229
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 );
228
231
WSUtils .setPropertyFilePath (path );
229
232
//System.setProperty(WSUtils.PROPERTY_FILE_PATH, path);
230
233
// final File fileExternal = new File(path);
@@ -233,17 +236,33 @@ private void preprocessConfigUrlServicesLocation() {
233
236
// System.setProperty(WSUtils.PROPERTY_FILE_PATH, path);
234
237
// }
235
238
}
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
+ }
244
255
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
+ }
245
263
} catch (final Exception e ) {
246
264
}
265
+
247
266
}
248
267
249
268
/**
0 commit comments