Commons IO
  1. Commons IO
  2. IO-74

Regular expression file name filter implementation

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: Filters
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      I've written a RegexFilter for commons-io. I'd like to share it with other's.
      Hope there'll be a JDK 1.4+ branch soon, so this can be applied.

        Issue Links

          Activity

          Hide
          Oliver Siegmar added a comment -

          Created an attachment (id=17535)
          RegexFilter

          Show
          Oliver Siegmar added a comment - Created an attachment (id=17535) RegexFilter
          Hide
          Henri Yandell added a comment -

          Consider this in the next release (along with the other regex filter) and accepting a dependency on Java 1.4.

          Show
          Henri Yandell added a comment - Consider this in the next release (along with the other regex filter) and accepting a dependency on Java 1.4.
          Hide
          Niall Pemberton added a comment - - edited

          Thanks for the patch Oliver - I have added this, but also done some refactoring. I removed the facility to specify arrays/lists of regular expression Strings for a number of reasons

          • firstly seemed like a good idea to add constructors that specifying either Pattern flags or case sensitivity (using IOCase), but adding all flavours for flags/case and array/List seemed cumbersome.
          • also the array/list facility only catered for OR conditions which is limiting since users may want AND - Commons IO already contains AndFileFilter / OrFileFilter implementations which can be used with RegexFileFilter to achieve both

          http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/RegexFileFilter.java?view=log

          Show
          Niall Pemberton added a comment - - edited Thanks for the patch Oliver - I have added this, but also done some refactoring. I removed the facility to specify arrays/lists of regular expression Strings for a number of reasons firstly seemed like a good idea to add constructors that specifying either Pattern flags or case sensitivity (using IOCase), but adding all flavours for flags/case and array/List seemed cumbersome. also the array/list facility only catered for OR conditions which is limiting since users may want AND - Commons IO already contains AndFileFilter / OrFileFilter implementations which can be used with RegexFileFilter to achieve both http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/filefilter/RegexFileFilter.java?view=log

            People

            • Assignee:
              Niall Pemberton
              Reporter:
              Oliver Siegmar
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development