public static DataSource fromEnvironment()

in freemarker-generator-base/src/main/java/org/apache/freemarker/generator/base/datasource/DataSourceFactory.java [164:175]


    public static DataSource fromEnvironment(String name, String group, String contentType) {
        try {
            final Properties properties = PropertiesFactory.create(System.getenv());
            final StringWriter writer = new StringWriter();
            properties.store(writer, null);
            final StringDataSource dataSource = new StringDataSource(name, writer.toString(), contentType, UTF_8);
            final URI uri = UriUtils.toUri(Location.ENVIRONMENT, "");
            return create(name, group, uri, dataSource, contentType, UTF_8, noProperties());
        } catch (IOException e) {
            throw new RuntimeException("Unable to load environment variables", e);
        }
    }