This PR successfully addresses #1317, 'CleanDirectory does not clean readonly files.'
I have familarised myself with #1574 when making this change (as @bjorkstromm mentioned) and in a similar manner, introduced a CleanDirectorySettings class which has a Force flag that defaults to false, but when enabled, will ensure the DirectoryCleaner will force clean readonly files.
I avoided making this a breaking change by creating overloads of the DirectoryCleaner methods that take an additional CleanDirectorySettings parameter, and did the same for the various DirectoryAliases methods.
If it was, however, decided that every clean method should take a settings parameter, we can keep the overloaded methods and simply remove the initial methods that didn't accept CleanDirectorySettings.
This PR successfully addresses #1317, 'CleanDirectory does not clean readonly files.'
I have familarised myself with #1574 when making this change (as @bjorkstromm mentioned) and in a similar manner, introduced a
CleanDirectorySettings
class which has aForce
flag that defaults to false, but when enabled, will ensure theDirectoryCleaner
will force clean readonly files.I avoided making this a breaking change by creating overloads of the
DirectoryCleaner
methods that take an additionalCleanDirectorySettings
parameter, and did the same for the variousDirectoryAliases
methods.If it was, however, decided that every clean method should take a settings parameter, we can keep the overloaded methods and simply remove the initial methods that didn't accept
CleanDirectorySettings
.