Last active
November 26, 2018 17:55
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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