You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Matt Sicker <bo...@gmail.com> on 2018/12/21 16:57:59 UTC

[IO] Robust file remover, other Windows-specific enhancements

I've been refactoring some IO code in Jenkins lately that are similar to
the FileUtils delete family of methods. I had originally wanted to replace
them with calls to FileUtils, but I noticed that we had a more
sophisticated strategy for retrying deletes and other workarounds for
(usually) Windows-specific problems (e.g., you can't delete an open file in
Windows; this can be commonly caused by things like virus scanners which
cause ephemeral errors).

My Jenkins code is here [1], and I was wondering if I could work on
contributing some of this logic back to commons-io in some way. There may
also be some useful utilities to include regarding Windows-specific
symbolic link/directory junction manipulation, too.

[1]: https://github.com/jenkinsci/jenkins/pull/3812

-- 
Matt Sicker <bo...@gmail.com>

Re: [IO] Robust file remover, other Windows-specific enhancements

Posted by Matt Sicker <bo...@gmail.com>.
After looking through the open issues and PRs for IO, I don't see anything
similar, though there is https://issues.apache.org/jira/browse/IO-295 which
may be related to junctions as well. This may also be a nice opportunity to
introduce a PathUtils class similar to FileUtils since IO already uses Java
7.

On Fri, 21 Dec 2018 at 10:57, Matt Sicker <bo...@gmail.com> wrote:

> I've been refactoring some IO code in Jenkins lately that are similar to
> the FileUtils delete family of methods. I had originally wanted to replace
> them with calls to FileUtils, but I noticed that we had a more
> sophisticated strategy for retrying deletes and other workarounds for
> (usually) Windows-specific problems (e.g., you can't delete an open file in
> Windows; this can be commonly caused by things like virus scanners which
> cause ephemeral errors).
>
> My Jenkins code is here [1], and I was wondering if I could work on
> contributing some of this logic back to commons-io in some way. There may
> also be some useful utilities to include regarding Windows-specific
> symbolic link/directory junction manipulation, too.
>
> [1]: https://github.com/jenkinsci/jenkins/pull/3812
>
> --
> Matt Sicker <bo...@gmail.com>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: [IO] Robust file remover, other Windows-specific enhancements

Posted by Matt Sicker <bo...@gmail.com>.
https://github.com/apache/commons-io/pull/72 for the PR.

On Sat, 22 Dec 2018 at 10:16, Gary Gregory <ga...@gmail.com> wrote:

> Nice :-)
>
> On Fri, Dec 21, 2018, 11:11 Matt Sicker <boards@gmail.com wrote:
>
> > I like that idea. I'll reorganize some code from the Jenkins PR into a
> one
> > for IO.
> >
> > On Fri, 21 Dec 2018 at 11:51, Gary Gregory <ga...@gmail.com>
> wrote:
> >
> > > That could go in Commons IO, sure.
> > >
> > > I would prefer the code to go in a focused class like a DeleteUtils or
> > > DeleteFiles. It might also be neat to make the class instantiable and
> > > configurable instead of having lots of options args.
> > >
> > > Gary
> > >
> > > On Fri, Dec 21, 2018, 09:58 Matt Sicker <boards@gmail.com wrote:
> > >
> > > > I've been refactoring some IO code in Jenkins lately that are similar
> > to
> > > > the FileUtils delete family of methods. I had originally wanted to
> > > replace
> > > > them with calls to FileUtils, but I noticed that we had a more
> > > > sophisticated strategy for retrying deletes and other workarounds for
> > > > (usually) Windows-specific problems (e.g., you can't delete an open
> > file
> > > in
> > > > Windows; this can be commonly caused by things like virus scanners
> > which
> > > > cause ephemeral errors).
> > > >
> > > > My Jenkins code is here [1], and I was wondering if I could work on
> > > > contributing some of this logic back to commons-io in some way. There
> > may
> > > > also be some useful utilities to include regarding Windows-specific
> > > > symbolic link/directory junction manipulation, too.
> > > >
> > > > [1]: https://github.com/jenkinsci/jenkins/pull/3812
> > > >
> > > > --
> > > > Matt Sicker <bo...@gmail.com>
> > > >
> > >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>


-- 
Matt Sicker <bo...@gmail.com>

Re: [IO] Robust file remover, other Windows-specific enhancements

Posted by Gary Gregory <ga...@gmail.com>.
Nice :-)

On Fri, Dec 21, 2018, 11:11 Matt Sicker <boards@gmail.com wrote:

> I like that idea. I'll reorganize some code from the Jenkins PR into a one
> for IO.
>
> On Fri, 21 Dec 2018 at 11:51, Gary Gregory <ga...@gmail.com> wrote:
>
> > That could go in Commons IO, sure.
> >
> > I would prefer the code to go in a focused class like a DeleteUtils or
> > DeleteFiles. It might also be neat to make the class instantiable and
> > configurable instead of having lots of options args.
> >
> > Gary
> >
> > On Fri, Dec 21, 2018, 09:58 Matt Sicker <boards@gmail.com wrote:
> >
> > > I've been refactoring some IO code in Jenkins lately that are similar
> to
> > > the FileUtils delete family of methods. I had originally wanted to
> > replace
> > > them with calls to FileUtils, but I noticed that we had a more
> > > sophisticated strategy for retrying deletes and other workarounds for
> > > (usually) Windows-specific problems (e.g., you can't delete an open
> file
> > in
> > > Windows; this can be commonly caused by things like virus scanners
> which
> > > cause ephemeral errors).
> > >
> > > My Jenkins code is here [1], and I was wondering if I could work on
> > > contributing some of this logic back to commons-io in some way. There
> may
> > > also be some useful utilities to include regarding Windows-specific
> > > symbolic link/directory junction manipulation, too.
> > >
> > > [1]: https://github.com/jenkinsci/jenkins/pull/3812
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> > >
> >
>
>
> --
> Matt Sicker <bo...@gmail.com>
>

Re: [IO] Robust file remover, other Windows-specific enhancements

Posted by Matt Sicker <bo...@gmail.com>.
I like that idea. I'll reorganize some code from the Jenkins PR into a one
for IO.

On Fri, 21 Dec 2018 at 11:51, Gary Gregory <ga...@gmail.com> wrote:

> That could go in Commons IO, sure.
>
> I would prefer the code to go in a focused class like a DeleteUtils or
> DeleteFiles. It might also be neat to make the class instantiable and
> configurable instead of having lots of options args.
>
> Gary
>
> On Fri, Dec 21, 2018, 09:58 Matt Sicker <boards@gmail.com wrote:
>
> > I've been refactoring some IO code in Jenkins lately that are similar to
> > the FileUtils delete family of methods. I had originally wanted to
> replace
> > them with calls to FileUtils, but I noticed that we had a more
> > sophisticated strategy for retrying deletes and other workarounds for
> > (usually) Windows-specific problems (e.g., you can't delete an open file
> in
> > Windows; this can be commonly caused by things like virus scanners which
> > cause ephemeral errors).
> >
> > My Jenkins code is here [1], and I was wondering if I could work on
> > contributing some of this logic back to commons-io in some way. There may
> > also be some useful utilities to include regarding Windows-specific
> > symbolic link/directory junction manipulation, too.
> >
> > [1]: https://github.com/jenkinsci/jenkins/pull/3812
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>


-- 
Matt Sicker <bo...@gmail.com>

Re: [IO] Robust file remover, other Windows-specific enhancements

Posted by Gary Gregory <ga...@gmail.com>.
That could go in Commons IO, sure.

I would prefer the code to go in a focused class like a DeleteUtils or
DeleteFiles. It might also be neat to make the class instantiable and
configurable instead of having lots of options args.

Gary

On Fri, Dec 21, 2018, 09:58 Matt Sicker <boards@gmail.com wrote:

> I've been refactoring some IO code in Jenkins lately that are similar to
> the FileUtils delete family of methods. I had originally wanted to replace
> them with calls to FileUtils, but I noticed that we had a more
> sophisticated strategy for retrying deletes and other workarounds for
> (usually) Windows-specific problems (e.g., you can't delete an open file in
> Windows; this can be commonly caused by things like virus scanners which
> cause ephemeral errors).
>
> My Jenkins code is here [1], and I was wondering if I could work on
> contributing some of this logic back to commons-io in some way. There may
> also be some useful utilities to include regarding Windows-specific
> symbolic link/directory junction manipulation, too.
>
> [1]: https://github.com/jenkinsci/jenkins/pull/3812
>
> --
> Matt Sicker <bo...@gmail.com>
>