I have a set of files in my Maven resource folder:
+ src
+ main
+ resources
+ mydir
+ myfile1.txt
+ myfile2.txt
How can I iterate mydir? Not only in Eclipse, but when running JUnit tests from the command line, and from a dependent jar.
File mydir = new File("mydir");
for (File f : dir.listFiles()) {
dosomething...
}
Thanks for a hint!
In the end, this is what I came up with to handle accessing files within referenced jars: