jbonofre opened a new pull request, #3080: URL: https://github.com/apache/karaf/pull/3080
Backport of #3079 to `karaf-4.4.x`. ## Depends on #3078 This builds on #3078 (the backport of #3001), which adds `FileUtils.atomicSave` to this branch. Until #3078 is merged, this PR also shows its commit; only the last commit belongs to this PR. Once #3078 is merged, I'll rebase this branch onto `karaf-4.4.x`. ## Changes Same as #3079: - `FileUtils.atomicSave` falls back to a plain `REPLACE_EXISTING` move on `AtomicMoveNotSupportedException`, as `SimpleDownloadTask` and `FeatureConfigInstaller.updateStorage` already do, instead of failing every save on such a file system. - The resolve request (`FeaturesServiceImpl.writeResolve`) is saved through `FileUtils.atomicSave`, as it was still written in place and is read back at startup. - The Activator's `StateStorage.getOutputStream()` is no longer used since `save()` is overridden; it throws instead of opening a truncating stream on `state.json`. - `ActivatorStateStorageTest`: the comment on the interrupted save is corrected, and the test checks that no temporary file is left behind. ## Differences from #3079 Only the import lists, which differ between the branches: `FeaturesServiceImpl` on this branch never imported `FileNotFoundException`, and `FeaturesServiceImplTest` keeps its `java.io.OutputStream` import, which is still used here. The code changes are the same. #3079 isn't merged yet, so any change made there during review should be applied here as well. ## Testing - [x] `mvn -pl util,features/core install` passes on this branch with JDK 11 (24 tests in `util`, 130 in `features/core`), including the new `FeaturesServiceImplTest.testPersistResolveRequest`. -- 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]
