class AcmFilesystemMailTemplateConfigurationService implements AcmMailTemplateConfigurationService {

    @Override
    public List<EmailTemplateConfiguration> getTemplateConfigurations() throws AcmEmailConfigurationException
    {
        Lock readLock = lock.readLock();
        readLock.lock();
        try (InputStream is = templateConfigurations.getInputStream())
        {
            List<EmailTemplateConfiguration> readConfigurationList = getObjectConverter().getJsonUnmarshaller()
                    .unmarshallCollection(IOUtils.toString(is, StandardCharsets.UTF_8), List.class, EmailTemplateConfiguration.class);
            if (readConfigurationList == null)
            {
                log.warn("Error while deserializing email templates configuration from {} file.", templateConfigurations.getDescription(),
                        null);
                throw new AcmEmailConfigurationJsonException(
                        String.format("Error while deserializing email templates configuration from %s file.",
                                templateConfigurations.getDescription()),
                        null);

            }
            return readConfigurationList;
        }
        catch (IOException e)
        {
            log.warn("Error while reading email templates configuration from {} file.", templateConfigurations.getDescription(), e);
            throw new AcmEmailConfigurationIOException(String.format("Error while reading email templates configuration from %s file.",
                    templateConfigurations.getDescription()), e);
        }
        finally
        {
            readLock.unlock();
        }
    }

}