Skip to content

Instantly share code, notes, and snippets.

@nkonev
Created May 6, 2018 17:12
Show Gist options
  • Select an option

  • Save nkonev/bc947768ddecb6abd920d12a47b5d753 to your computer and use it in GitHub Desktop.

Select an option

Save nkonev/bc947768ddecb6abd920d12a47b5d753 to your computer and use it in GitHub Desktop.
@Value("classpath:ololo.properties")
//@Value("file:/home/nik/ideaWorkspace/blog/backend/src/main/resources/ololo.properties")
Resource resource;
@GetMapping(value = "/ololo", produces = TEXT_HTML_VALUE)
public String getOlolo() throws IOException {
try(BufferedReader br = new BufferedReader(new InputStreamReader(resource.getInputStream()));) {
return br.lines().collect(Collectors.joining("\n"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment