Configuration::readConfiguration(@Nonnull final String uri) should use time-proven libs to load config remotely/locally instead of managing low-level details. Taking advantage of the libs reduce length of the method and improve readability by hiding low-level details.
- For loading text file over http/https use apache http client EntityUtils
- For loading text file from local filesystem, use Java7 API, e.g.
new String(Files.readAllBytes(Paths.get(new File(uri))))
- For loading from classpath, use
ClassPathResource in solution above