I am trying the below code where i reading files and executing from the resources folder.
File[] fileList = (new File(getClass().getResource("/jsonData").toURI())).listFiles();
for (File file : fileList) {
if (file.isFile()) {
System.out.println(file.toString());
}
}
Now when trying to make build in test env I am getting this error :
Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
After investigation on internet I am using below code but no luck, (I need to read folder and its file.)
File[] fileList = (new File(getClass().getResourceAsStream("/geoJson").toString())).listFiles();