Added checkConfig

This commit is contained in:
Francesco Mangiacrapa 2023-11-22 11:23:36 +01:00
parent 5e2b90c1d4
commit 7fcfc6a6ec
1 changed files with 14 additions and 4 deletions

View File

@ -117,17 +117,27 @@ public class Geoportal_PDF_Exporter {
*/
private PDFExporterConfig readPDFExporterConfigsFromGR() {
PDFExporterConfigProvider credits = new PDFExporterConfigProvider();
PDFExporterConfig paths = null;
PDFExporterConfigProvider exporterProvider = new PDFExporterConfigProvider();
PDFExporterConfig exporterConfig = null;
try {
paths = credits.readConfigsFromGR();
exporterConfig = exporterProvider.readConfigsFromGR();
} catch (Exception ex) {
LOG.warn("no pdf credits found");
}
return paths;
return exporterConfig;
}
/**
* Check config.
*
* @return true, if the PDFExporterConfig (means the proper GR see {@link PDFExporterConfigProvider}) exists, false otherwise.
*/
public boolean checkConfig() {
PDFExporterConfig exporterConfig = readPDFExporterConfigsFromGR();
return exporterConfig != null;
}
/**