Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-159

[finder] Make FileFilter implementations public classes in their own package.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Finder
    • Labels:
      None

      Description

      I'm attaching a patch which extracts the FileFilter implementations out of the FindingFilter class into a separate "filters" package. This will allow them to be re-used in conjunction with a new CompositeFilter.

      I've created a new CompositeFilter implementation (which FindingFilter is now based on) which can do AND or OR processing which I think will allow quite powerful FileFilter implementations to be created - since CompositeFilters themselves can be used as component FileFilters for more complex CompositeFilters.

      For example to select files which are less than 1MB and have been modified in the last 20 days

      CompositeFilter filter1 = new CompositeFilter(false, true);
      filter1.addFilter(new SizeFilter(false, "-1m"));
      filter1.addFilter(new TimeFilter(false, 20, false));

      As a by-product IMO it will also make creating test cases for the individual FileFilter implementations easier.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              niallp Niall Pemberton

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment