org-arl / fjage

Framework for Java and Groovy Agents
https://fjage.readthedocs.io/en/latest/
Other
26 stars 13 forks source link

Iterate over all resources in all jars to serve #255

Closed notthetup closed 2 years ago

notthetup commented 2 years ago

When adding a resource from to be served from the fjage WebServer, a getClass().getResource(resource) will only find a single resource that is available. So if we do websvr.add("/dashboards", "/dashboards") it will find the first resource in all of the jars with a resource called /dashboards and only serve that.

But it's possible that multiple jars have resources with the same name and that won't get added here. This change iterates through all resources with the given name and adds them to the same path.