1) The name of the method is error prone! I would rename it into readStringFromFile().
2) Move it to class FileUtils
3) as you can see, you have duplicated code here and in the "if" above. How could you rewrite so that's more elegant?