epugh opened a new pull request, #5260: URL: https://github.com/apache/solr/pull/5260
## Summary Small cleanup follow-up to #4672 (already merged), from a `/simplify` pass that landed one commit after that PR was squash-merged, so it never made it in. - `Utils.zipDirectory(Path)` was shaped around "return bytes for an HTTP body" - fine for its two other callers (`CreateTool`, `DownloadConfigSet`), but it forced `RemoteSolrBackend.uploadConfigSet` to buffer the entire configset zip in memory just to write it straight back out to a temp file it already had open (`Files.write(tempZip, Utils.zipDirectory(configDir))`). Added a streaming `zipDirectory(Path, OutputStream)` overload with the shared walk/skip-hidden/normalize-separator logic in one place; the byte[]-returning version now delegates to it, and `RemoteSolrBackend` calls the streaming form directly against `Files.newOutputStream(tempZip)`, restoring the original single-pass I/O. - Removed `CreateTool.zipConfigSet(Path)`, a pure one-line passthrough to `Utils.zipDirectory` with no behavior of its own. Both call sites (the production upload call and `CreateToolTest`) now call `Utils.zipDirectory` directly. - Added a test confirming the two `zipDirectory` overloads produce equivalent archives - compared by decoded entry name/content rather than raw bytes, since `ZipEntry` defaults to the current time when none is set explicitly, so two back-to-back calls aren't guaranteed byte-identical. ## Test plan - [x] `CreateToolTest`, `CreateToolPicocliTest`, `TestSchemaDesignerConfigSetHelper` (14 tests) all pass - [x] Full `compileJava`/`compileTestJava` across the repo is clean - [x] `./gradlew tidy` clean - [x] Verified the commit cherry-picks cleanly onto current `main` (post-#4672 squash-merge) and re-ran the test suite there 🤖 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
