Package org.alfresco.filesys.repo
Class ContentSearchContext
- java.lang.Object
-
- org.alfresco.jlan.server.filesys.SearchContext
-
- org.alfresco.filesys.repo.ContentSearchContext
-
- All Implemented Interfaces:
InFlightCorrectable
- Direct Known Subclasses:
DotDotContentSearchContext
public class ContentSearchContext extends org.alfresco.jlan.server.filesys.SearchContext implements InFlightCorrectable
Wrapper for simple XPath searche against the node service. The search is performed statically outside the context instance itself - this class merely maintains the state of the search results across client connections.- Author:
- Derek Hulley
-
-
Field Summary
Fields Modifier and Type Field Description static intLinkFileSize
-
Constructor Summary
Constructors Modifier Constructor Description protectedContentSearchContext(CifsHelper cifsHelper, java.util.List<org.alfresco.service.cmr.repository.NodeRef> results, java.lang.String searchStr, java.lang.String relPath, boolean lockedFilesAsOffline)Class constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetRelativePath()Return the relative path that is being searchedprotected intgetResultsSize()Return the results array sizeintgetResumeId()Return the resume id for the current file/directory in the search.booleanhasMoreFiles()Determine if there are more files for the active search.booleannextFileInfo(org.alfresco.jlan.server.filesys.FileInfo info)Return file information for the next file in the active search.java.lang.StringnextFileName()Return the file name of the next file in the active search.booleanrestartAt(int resumeIdParameter)Restart the current search at the specified file.booleanrestartAt(org.alfresco.jlan.server.filesys.FileInfo info)Restart a search at the specified resume point.voidsetInFlightCorrector(InFlightCorrector corrector)java.lang.StringtoString()Return the search as a string
-
-
-
Field Detail
-
LinkFileSize
public static final int LinkFileSize
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContentSearchContext
protected ContentSearchContext(CifsHelper cifsHelper, java.util.List<org.alfresco.service.cmr.repository.NodeRef> results, java.lang.String searchStr, java.lang.String relPath, boolean lockedFilesAsOffline)
Class constructor- Parameters:
cifsHelper- Filesystem helper classresults- List of file/folder nodes that match the search patternsearchStr- Search pathrelPath- Relative path being searched
-
-
Method Detail
-
setInFlightCorrector
public void setInFlightCorrector(InFlightCorrector corrector)
- Specified by:
setInFlightCorrectorin interfaceInFlightCorrectable
-
toString
public java.lang.String toString()
Return the search as a string- Overrides:
toStringin classorg.alfresco.jlan.server.filesys.SearchContext- Returns:
- String
-
getResumeId
public int getResumeId()
Return the resume id for the current file/directory in the search.- Specified by:
getResumeIdin classorg.alfresco.jlan.server.filesys.SearchContext- Returns:
- int
-
hasMoreFiles
public boolean hasMoreFiles()
Determine if there are more files for the active search.- Specified by:
hasMoreFilesin classorg.alfresco.jlan.server.filesys.SearchContext- Returns:
- boolean
-
nextFileInfo
public boolean nextFileInfo(org.alfresco.jlan.server.filesys.FileInfo info)
Return file information for the next file in the active search. Returns false if the search is complete.- Specified by:
nextFileInfoin classorg.alfresco.jlan.server.filesys.SearchContext- Parameters:
info- FileInfo to return the file information.- Returns:
- true if the file information is valid, else false
-
nextFileName
public java.lang.String nextFileName()
Return the file name of the next file in the active search. Returns null is the search is complete.- Specified by:
nextFileNamein classorg.alfresco.jlan.server.filesys.SearchContext- Returns:
- String
-
restartAt
public boolean restartAt(org.alfresco.jlan.server.filesys.FileInfo info)
Restart a search at the specified resume point.- Specified by:
restartAtin classorg.alfresco.jlan.server.filesys.SearchContext- Parameters:
info- File to restart the search at.- Returns:
- true if the search can be restarted, else false.
-
restartAt
public boolean restartAt(int resumeIdParameter)
Restart the current search at the specified file.- Specified by:
restartAtin classorg.alfresco.jlan.server.filesys.SearchContext- Returns:
- true if the search can be restarted, else false.
-
getRelativePath
protected java.lang.String getRelativePath()
Return the relative path that is being searched- Returns:
- String
-
getResultsSize
protected int getResultsSize()
Return the results array size- Returns:
- int
-
-