public abstract class SearchContext
extends java.lang.Object
The search context represents the state of an active search by a disk interface based class. The context is used to continue a search across multiple requests.
Modifier | Constructor and Description |
---|---|
|
SearchContext()
Default constructor.
|
protected |
SearchContext(int maxFiles,
int treeId)
Construct a new search context.
|
Modifier and Type | Method and Description |
---|---|
void |
closeSearch()
Close the search.
|
boolean |
getDotDotInfo(FileInfo finfo)
Return the '..' pseudo entry details
|
boolean |
getDotInfo(FileInfo finfo)
Return the '.' pseudo entry details
|
int |
getFlags()
Return the search context flags.
|
int |
getMaximumFiles()
Return the maximum number of files that should be returned per search request.
|
abstract int |
getResumeId()
Return the resume id for the current file/directory in the search.
|
java.lang.String |
getSearchString()
Return the search string, used for resume keys in some SMB dialects.
|
int |
getTreeId()
Return the tree identifier of the tree connection that this search is associated with.
|
boolean |
hasDotFiles()
Wildcard searches return entries for the '.' and '..' pseudo entries
|
abstract boolean |
hasMoreFiles()
Determine if there are more files for the active search.
|
abstract boolean |
nextFileInfo(FileInfo info)
Return file information for the next file in the active search.
|
abstract java.lang.String |
nextFileName()
Return the file name of the next file in the active search.
|
int |
numberOfEntries()
Return the total number of file entries for this search if known, else return -1
|
abstract boolean |
restartAt(FileInfo info)
Restart the current search at the specified file.
|
abstract boolean |
restartAt(int resumeId)
Restart a search at the specified resume point.
|
void |
setFlags(int flg)
Set the search context flags.
|
void |
setMaximumFiles(int maxFiles)
Set the maximum files to return per request packet.
|
void |
setSearchString(java.lang.String str)
Set the search string.
|
void |
setTreeId(int id)
Set the tree connection id that the search is associated with.
|
java.lang.String |
toString()
Return the search context as a string.
|
public SearchContext()
protected SearchContext(int maxFiles, int treeId)
maxFiles
- inttreeId
- intpublic void closeSearch()
public final int getFlags()
public final int getMaximumFiles()
public abstract int getResumeId()
public final java.lang.String getSearchString()
public final int getTreeId()
public abstract boolean hasMoreFiles()
public abstract boolean nextFileInfo(FileInfo info)
info
- FileInfo to return the file information.public abstract java.lang.String nextFileName()
public int numberOfEntries()
public abstract boolean restartAt(int resumeId)
resumeId
- Resume point id.public abstract boolean restartAt(FileInfo info)
info
- File to restart the search at.public final void setFlags(int flg)
flg
- intpublic final void setMaximumFiles(int maxFiles)
maxFiles
- intpublic final void setSearchString(java.lang.String str)
str
- java.lang.Stringpublic final void setTreeId(int id)
id
- intpublic boolean hasDotFiles()
public boolean getDotInfo(FileInfo finfo)
finfo
- FileInfopublic boolean getDotDotInfo(FileInfo finfo)
finfo
- FileInfopublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.