commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Commented: (IO-119) Convenience "Builder" for creating complex FileFilter conditions
Date Mon, 11 Feb 2008 12:02:15 GMT


Niall Pemberton commented on IO-119:

@Gary - I agree with your general principles about clarity and writing and maintaining code,
but IMO you can have both - terse code thats clearer. Personally I dislike IDE code formatting,
it always seems to screw up and make things less readable - which IMO is a bigger hinderance
to maintaining the code long term.

Anyway, this is an alternative option for people who do prefer it - those that don't can use
the FileFilterUtils or the implementations directly.

> Convenience "Builder" for creating complex FileFilter conditions
> ----------------------------------------------------------------
>                 Key: IO-119
>                 URL:
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Filters
>    Affects Versions: 1.3.1
>            Reporter: Niall Pemberton
>            Assignee: Niall Pemberton
>            Priority: Minor
>             Fix For: 2.x
>         Attachments:,
> I'd like to add a new convenience "builder" class (FileFilterBuilder) to make it easier
to create complex FileFilter using Commons IO's IOFileFilter implementations.
> Heres an example of how it can be used to create a IOFileFilter for the following conditions:
>  - Either, directories which are not hidden and not named ".svn"
>  - or, files which have a suffix of ".java"
>     IOFileFilter filter = FileFilterBuilder.orBuilder()
>         .and().isDirectory().isHidden(false).not().name(".svn").end()
>         .and().isFile().suffix(".java").end()
>         .getFileFilter();

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message