import org.apache.commons.io.IOUtils; InputStream inStream = new FileInputStream("filename.txt"); String body = IOUtils.toString(inStream, StandardCharsets.UTF_8.name());