You're approach is fine. In this case it is better to talk it out here IMO,
before writing code in a PR. I'm not sure it is possible to change the
existing File-based API and have behavior that kinda matches across all
Commons IO versions in a way that will make everyone happy. The good thing
is that you have a way forward that works.

Gary

On Sat, Aug 20, 2022, 16:45 Tres Finocchiaro <tres.finocchi...@gmail.com>
wrote:

> >
> > What about using an empty array as input to PathUtils.copyDirectory(Path,
> > Path, CopyOption...) ?
>
>
> Yes, as long as StandardCopyOptions.*REPLACE_EXISTING* is provided, which
> seems to mimic the former:
>
> PathUtils.copyDirectory(folder.toPath(), dest.toPath(),
> > StandardCopyOption.REPLACE_EXISTING);
>
>
> This new PathUtils API does work as expected.
>
> In my case, I'm already using Path (not File) internally in most places, so
> this could be argued as a slight improvement, however the lack of a
> FileUtils.copyFile(...) equivalent still means we need to -- for now --
> keep around the lingering "false" in places that we copy single files while
> changing their names.
>
> > You can always provide a PR on GitHub to see what a fix would look like.
>
>
> Do you recommend this direct-proposal approach versus submitting a bug
> report and getting buy-in first?
>
> In its current form copying Windows files is (in my opinion) completely
> broken, so I would suspect the the only instances that would complain are:
>
>    - Edge-cases with Unix (I would need to test the impact, similar to how
>    I used "icacls" on Windows)
>    - Windows environments that were accidentally benefiting from this bug,
>    which is really people who really wanted COPY_ATTRIBUTES but never
> provided
>    this as an option.
>
> The former (to me) is more concerning.
>
> -Tres
>
> - tres.finocchi...@gmail.com
>
>
> On Sat, Aug 20, 2022 at 4:13 PM Gary Gregory <garydgreg...@gmail.com>
> wrote:
>
> > Tres,
> >
> > Yeah, I/we got caught here in the desire to provide backward
> compatibility
> > and update the implementation to NIO. You might want to also try the
> > 2.12.0-SNAPSHOT from
> >
> >
> https://repository.apache.org/content/repositories/snapshots/commons-io/commons-io/2.12.0-SNAPSHOT/
> >
> > What about using an empty array as input to PathUtils.copyDirectory(Path,
> > Path, CopyOption...) ?
> >
> > Gary
> >
> > On Sat, Aug 20, 2022 at 3:17 PM Tres Finocchiaro <
> > tres.finocchi...@gmail.com>
> > wrote:
> >
> > > Gary,
> > >
> > > Thanks again for your reply however COPY_ATTRIBUTES is the source of
> the
> > > problem, it's being added and wiping out the permissions.
> > >
> > > I've linked my suspicion as to why in my previous email.
> > >
> > > For now, I will toggle-off the preserveFileDate, which seems to be the
> > only
> > > workaround for this problem.
> > >
> > > Best regards.
> > >
> > >
> > > - tres.finocchi...@gmail.com
> > >
> > > >
> > > >
> > >
> >
>

Reply via email to