Did you consider using IOUtils.toString(URI)?