codehaus-plexus / plexus-archiver

https://codehaus-plexus.github.io/plexus-archiver/
Apache License 2.0
44 stars 48 forks source link

No fluent setter for usingDefaultExcludes in AbstractFileSet #311

Closed redzi closed 11 months ago

redzi commented 11 months ago

This is not an issue but a proposal for a very minor change that would make the creation of FileSets easier. There is no fluent way of setting the usingDefaultExcludes flag in AbstractFileSet.

Due to this inconvenience instead of a completely fluent way of creating a FileSet instance:

fileSet(new File("foo"))
          .prefixed("pfx")
          .include(includes)
          .exclude(exc)
          .usingDefaultExcludes(usingDefaultExcludes);

one needs to do it like this:

DefaultFileSet fileSet = fileSet(new File("foo"))
          .prefixed("pfx")
          .include(includes)
          .exclude(exc);

fileSet.setUsingDefaultExcludes(false);

The fileSet variable needs to be of type DefaultFileSet because the FileSet interface does not provide the setter.

redzi commented 11 months ago

PR with the addition of the fluent setter: https://github.com/codehaus-plexus/plexus-archiver/pull/312