Skip to content

Instantly share code, notes, and snippets.

@iamitshri
Last active November 26, 2018 17:55
Show Gist options
  • Save iamitshri/42d7d6dfd5134443dda90e38843e2e34 to your computer and use it in GitHub Desktop.
Save iamitshri/42d7d6dfd5134443dda90e38843e2e34 to your computer and use it in GitHub Desktop.
Get Files under the folder in src/main/resources in spring boot app
private void getFile() throws IOException {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
List<Resource> files = Arrays.asList(resolver.getResources("classpath*:folder-name"));
for(Resource file : files) {
for(File file1 : file.getFile().listFiles()) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment