wildfly / galleon

Galleon Provisioning Tool
https://docs.wildfly.org/galleon/
Apache License 2.0
27 stars 30 forks source link

[GAL-335] Readonly files in server directory break update operation #307

Closed spyrkob closed 2 years ago

spyrkob commented 2 years ago

Issue: https://issues.redhat.com/browse/GAL-335

Galleon could ignore exception when copying file that already exists (ie. was not deleted).

jfdenise commented 2 years ago

@spyrkob , I would prefer the second suggestion, introduce a new IoUtils.copy(Path source, Path target, boolean ignoreFailure) and existing IoUtils.copy(Path source, Path target) to call into the new one with false. The method would try to copy, but if an Exception is raised, just ignore it. We have IoUtils.recursiveDelete that ignores the file we can't delete, so would make sense. WDYT?

spyrkob commented 2 years ago

Yes, I think it's a simpler option. I was worried it might hide some cases where there's a genuine issue. But the only scenario I can think of is if user marks one of files generated by FP as read-only - in which case I think we shouldn't override it either way

spyrkob commented 2 years ago

Updated with new IoUtils#copy version

spyrkob commented 2 years ago

Now it should be correct. Sorry, got the previous change completely mixed up

jfdenise commented 2 years ago

@spyrkob , thank-you, merged.