- public static getAuthorizedTags(
- stationInfo: ChargingStationInfo,
- templateFile: string,
- logPrefix: string
- ): string[] {
- let authorizedTags: string[] = [];
- const authorizationFile = ChargingStationUtils.getAuthorizationFile(stationInfo);
- if (authorizationFile) {
- try {
- // Load authorization file
- authorizedTags = JSON.parse(fs.readFileSync(authorizationFile, 'utf8')) as string[];
- } catch (error) {
- FileUtils.handleFileException(
- logPrefix,
- FileType.Authorization,
- authorizationFile,
- error as NodeJS.ErrnoException
- );
- }
- } else {
- logger.info(logPrefix + ' No authorization file given in template file ' + templateFile);
- }
- return authorizedTags;
- }
-