1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.finder;
18
19 import java.io.File;
20 import java.util.Map;
21
22 import org.apache.commons.io.filefilter.DirectoryFileFilter;
23 import org.apache.commons.io.filefilter.CanReadFileFilter;
24 import org.apache.commons.io.filefilter.CanWriteFileFilter;
25 import org.apache.commons.io.filefilter.EmptyFileFilter;
26 import org.apache.commons.io.filefilter.HiddenFileFilter;
27 import org.apache.commons.io.filefilter.IOFileFilter;
28 import org.apache.commons.io.filefilter.NotFileFilter;
29
30
31
32
33
34 public interface Finder {
35
36
37 public static final String NOT = "NOT_";
38
39
40 public static final String DAYSTART = "DAYSTART";
41 public static final String DEPTH = "DEPTH";
42 public static final String MAXDEPTH = "MAXDEPTH";
43 public static final String MINDEPTH = "MINDEPTH";
44 public static final String IGNORE_HIDDEN_DIRS = "IGNORE_HIDDEN_DIRS";
45
46
47 public static final String MIN = "MIN";
48 public static final String NEWER = "NEWER";
49 public static final String TIME = "TIME";
50
51
52 public static final IOFileFilter EMPTY = EmptyFileFilter.EMPTY;
53 public static final IOFileFilter NOT_EMPTY = EmptyFileFilter.NOT_EMPTY;
54 public static final String SIZE = "SIZE";
55
56
57 public static final String NAME = "NAME";
58 public static final String INAME = "INAME";
59 public static final String PATH = "PATH";
60 public static final String IPATH = "IPATH";
61 public static final String REGEX = "REGEX";
62 public static final String IREGEX = "IREGEX";
63
64
65 public static final IOFileFilter DIRECTORY = DirectoryFileFilter.INSTANCE;
66 public static final IOFileFilter FILE = new NotFileFilter(DirectoryFileFilter.INSTANCE);
67 public static final IOFileFilter HIDDEN = HiddenFileFilter.HIDDEN;
68 public static final IOFileFilter VISIBLE = HiddenFileFilter.VISIBLE;
69
70
71 public static final IOFileFilter CAN_READ = CanReadFileFilter.CAN_READ;
72 public static final IOFileFilter CANNOT_READ = CanReadFileFilter.CANNOT_READ;
73 public static final IOFileFilter CAN_WRITE = CanWriteFileFilter.CAN_WRITE;
74 public static final IOFileFilter CANNOT_WRITE = CanWriteFileFilter.CANNOT_WRITE;
75
76 public void addFindListener(FindListener fl);
77 public void removeFindListener(FindListener fl);
78
79 public File[] find(File root);
80 public File[] find(File root, Map options);
81
82 }