davsclaus opened a new pull request, #27024: URL: https://github.com/apache/camel/pull/27024
_Claude Code on behalf of davsclaus_ ## What `/q/download?classpath=true` is meant to list the resources of the application, but it only listed the route files. Fixes [CAMEL-25116](https://issues.apache.org/jira/browse/CAMEL-25116). The old code scanned with `**/*` from the classpath root, which ends up in `ClassLoader.getResources("")`. That only returns directories, never the root of a JAR. It also cannot see the extra files that `camel run` adds via `ExtraFilesClassLoader`. ## Changes - `classpath=true` now lists the application's own resources: - classpath directories (such as `target/classes`) - the classes folder of a packaged fat JAR (`BOOT-INF/classes`) - the application JAR itself, found via the base package scan (the package of the main class). A JAR is not returned as a classpath root. - with `camel run`: the extra classpath files and the `file:` properties locations, but only files inside the working directory. Dependency JARs, `.class` files and `META-INF/` are not included. - Downloading by name falls back to those project files, so `application.properties` downloads in dev mode (it returned 204 before). - Route names from a packaged JAR show the path inside the JAR (`camel/foo.camel.yaml`). Before, they showed the full nested JAR path plus a line number. - Docs updated. Download is an opt-in feature marked `insecure:dev`, so it fails under the `prod` profile. The only new files it can serve are files inside the working directory that `camel run` loaded. A packaged app already serves `application.properties` by name. ## Testing Tested with a user's reproducer (2 yaml routes, `application.properties`, `openapi.json`, `form1.form.json`). `/q/download?classpath=true` now lists all files in: - `camel run *` (dev mode) - the exported camel-main app run as the container does (thin JAR + `lib/`) - the fat JAR run on its own - the fat JAR run inside `target/` - `java -cp target/classes:target/lib/*` On 4.22.1 only the 2 route files were listed. New test `ManagementHttpServerTest#downloadListsApplicationResources`, and the module tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
