All Downloads are FREE. Search and download functionalities are using the official Maven repository.

quickstart.src.main.java.org.gradle.sample.Greeter Maven / Gradle / Ivy

There is a newer version: 8.11.1
Show newest version
package org.gradle.sample;

import java.io.InputStream;
import org.apache.log4j.LogManager;
import org.apache.commons.io.IOUtils;

public class Greeter {
    public String getGreeting() throws Exception {
        LogManager.getRootLogger().info("generating greeting.");
        InputStream greetingStr = getClass().getResourceAsStream("/greeting.txt");
        try {
            return IOUtils.toString(greetingStr).trim();
        }
        finally {
            greetingStr.close();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy