1 package org.codehaus.mojo.vfs.internal;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import java.util.List;
23
24 import org.apache.commons.vfs2.FileObject;
25 import org.apache.commons.vfs2.FileSystemException;
26
27 public interface VfsDirectoryScanner
28 {
29
30 void setStartingDirectory( FileObject directory );
31
32 /**
33 * Sets the list of include patterns to use. All '/' and '\' characters are replaced by
34 * <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
35 * <p>
36 * When a pattern ends with a '/' or '\', "**" is appended.
37 *
38 * @param includes A list of include patterns. May be <code>null</code>, indicating that all files should be
39 * included. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
40 */
41 void setIncludes( String[] includes );
42
43 /**
44 * Sets the list of exclude patterns to use. All '\' characters are replaced by '/'
45 * <p>
46 * When a pattern ends with a '/' or '\', "**" is appended.
47 *
48 * @param excludes A list of exclude patterns. May be <code>null</code>, indicating that no files should be
49 * excluded. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
50 */
51 void setExcludes( String[] excludes );
52
53 /**
54 * @param isCaseSensitive
55 */
56 void setCaseSensitive( boolean isCaseSensitive );
57
58 /**
59 * Start the scan
60 *
61 * @return
62 * @throws FileSystemException
63 */
64 List<FileObject> scan()
65 throws FileSystemException;
66
67 }