1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.creadur.tentacles.filter;
20
21 import java.io.File;
22 import java.io.FileFilter;
23
24 public class Filters {
25
26 private final FilesOnlyFilter filesOnly;
27 private final LicenseFilter licensesOnly;
28 private final NoticeFilter noticesOnly;
29 private final LegalFilter legalOnly;
30
31 public Filters() {
32 this.filesOnly = new FilesOnlyFilter();
33 this.licensesOnly = new LicenseFilter();
34 this.noticesOnly = new NoticeFilter();
35 this.legalOnly = new LegalFilter();
36 }
37
38 public FileFilter filesOnly() {
39 return this.filesOnly;
40 }
41
42 public FileFilter licensesOnly() {
43 return this.licensesOnly;
44 }
45
46 public FileFilter noticesOnly() {
47 return this.noticesOnly;
48 }
49
50 public FileFilter legalOnly() {
51 return this.legalOnly;
52 }
53
54 public FileFilter licensesDeclaredIn(final File contents) {
55 return new AndFilter(new DeclaredFilter(contents), new LicenseFilter());
56
57 }
58
59 public FileFilter noticesDeclaredIn(final File contents) {
60 return new AndFilter(new DeclaredFilter(contents), new NoticeFilter());
61 }
62
63 public FileFilter legalDocumentsUndeclaredIn(final File contents) {
64 return new AndFilter(new NotFilter(new DeclaredFilter(contents)),
65 new LegalFilter());
66 }
67
68 public FileFilter legalDocumentsDeclaredIn(final File contents) {
69 return new AndFilter(new DeclaredFilter(contents), new LegalFilter());
70 }
71
72 public FileFilter archivesInPath(final String repositoryPathNameFilter) {
73 return new IsArchiveInPathFilter(repositoryPathNameFilter);
74 }
75 }