KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > vfs > Selectors


1 /*
2  * Copyright 2002-2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.commons.vfs;
17
18 /**
19  * Several standard file selectors.
20  *
21  * @author <a HREF="mailto:adammurdoch@apache.org">Adam Murdoch</a>
22  */

23 public interface Selectors
24 {
25     /**
26      * A {@link FileSelector} that selects only the base file/folder.
27      */

28     FileSelector SELECT_SELF = new FileDepthSelector(0, 0);
29
30     /**
31      * A {@link FileSelector} that selects the base file/folder and its
32      * direct children.
33      */

34     FileSelector SELECT_SELF_AND_CHILDREN = new FileDepthSelector(0, 1);
35
36     /**
37      * A {@link FileSelector} that selects only the direct children
38      * of the base folder.
39      */

40     FileSelector SELECT_CHILDREN = new FileDepthSelector(1, 1);
41
42     /**
43      * A {@link FileSelector} that selects all the descendents of the
44      * base folder, but does not select the base folder itself.
45      */

46     FileSelector EXCLUDE_SELF = new FileDepthSelector(1, Integer.MAX_VALUE);
47
48     /**
49      * A {@link FileSelector} that only files (not folders).
50      */

51     FileSelector SELECT_FILES = new FileTypeSelector(FileType.FILE);
52
53     /**
54      * A {@link FileSelector} that only folders (not files).
55      */

56     FileSelector SELECT_FOLDERS = new FileTypeSelector(FileType.FOLDER);
57
58     /**
59      * A {@link FileSelector} that selects the base file/folder, plus all
60      * its descendents.
61      */

62     FileSelector SELECT_ALL = new AllFileSelector();
63 }
64
Popular Tags