base/common/src/main/com/thesett/common/util/FileUtils.java
public static String readFileAsString(String filename)
    {
        BufferedInputStream is = null;

        try
        {
            is = new BufferedInputStream(new FileInputStream(filename));
        }
        catch (FileNotFoundException e)
        {
            throw new IllegalStateException(e);
        }

        return readStreamAsString(is);
    }
public static String readFileAsString(String filename)
    {
        BufferedInputStream is = null;

        try
        {
            is = new BufferedInputStream(new FileInputStream(filename));
        }
        catch (FileNotFoundException e)
        {
            throw new IllegalStateException(e);
        }

        return readStreamAsString(is);
    }
Reads a text file as a string.

@param  filename The name of the file.

@return The contents of the file.