站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

FileObjectFilter (Search API) - NetBeans API Javadoc (Current Development Version)

org.openidex.util/3 3.11

org.openidex.search
Interface FileObjectFilter


public interface FileObjectFilter

Implementations of this interface define which files and folders should be searched and which should be skipped during search over a directory structure.

Since:
org.openidex.util/3 3.3

Field Summary
static int DO_NOT_TRAVERSE
          constant representing answer "do not traverse the folder"
static int TRAVERSE
          constant representing answer "traverse the folder"
static int TRAVERSE_ALL_SUBFOLDERS
          constant representing answer "traverse the folder and all its direct and indirect children (both files and subfolders)"
 
Method Summary
 boolean searchFile(FileObject file)
          Answers a question whether a given file should be searched.
 int traverseFolder(FileObject folder)
          Answers a questions whether a given folder should be traversed (its contents searched).
 

Field Detail

DO_NOT_TRAVERSE

static final int DO_NOT_TRAVERSE
constant representing answer "do not traverse the folder"

See Also:
Constant Field Values

TRAVERSE

static final int TRAVERSE
constant representing answer "traverse the folder"

See Also:
Constant Field Values

TRAVERSE_ALL_SUBFOLDERS

static final int TRAVERSE_ALL_SUBFOLDERS
constant representing answer "traverse the folder and all its direct and indirect children (both files and subfolders)"

See Also:
Constant Field Values
Method Detail

searchFile

boolean searchFile(FileObject file)
                   throws IllegalArgumentException
Answers a question whether a given file should be searched. The file must be a plain file (not folder).

Returns:
true if the given file should be searched; false if not
Throws:
IllegalArgumentException - if the passed FileObject is a folder

traverseFolder

int traverseFolder(FileObject folder)
                   throws IllegalArgumentException
Answers a questions whether a given folder should be traversed (its contents searched). The passed argument must be a folder.

Returns:
one of constants DO_NOT_TRAVERSE, TRAVERSE, TRAVERSE_ALL_SUBFOLDERS; if TRAVERSE_ALL_SUBFOLDERS is returned, this filter will not be applied on the folder's children (both direct and indirect, both files and folders)
Throws:
IllegalArgumentException - if the passed FileObject is not a folder

org.openidex.util/3 3.11

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.