Class FSDirectoryManager
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.directory.FSDirectoryManager
-
- All Implemented Interfaces:
DirectoryManager
public class FSDirectoryManager extends Object implements DirectoryManager
FSDirectoryManagerimplements a directory manager forFSDirectoryinstances.
-
-
Constructor Summary
Constructors Constructor Description FSDirectoryManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(String name)Deletes the directory with the given name.voiddispose()Frees resources associated with this directory manager.DirectorygetDirectory(String name)Gets the directory with the givenname.String[]getDirectoryNames()Returns the names of the currently available directories.booleanhasDirectory(String name)Checks if there exists a directory with the givenname.voidinit(SearchIndex handler)Initializes the directory manager with a reference to the search index.booleanrename(String from, String to)Renames a directory.
-
-
-
Method Detail
-
init
public void init(SearchIndex handler) throws IOException
Initializes the directory manager with a reference to the search index.- Specified by:
initin interfaceDirectoryManager- Parameters:
handler- the query handler implementation.- Throws:
IOException- if an error occurs while initializing the directory manager.
-
hasDirectory
public boolean hasDirectory(String name) throws IOException
Checks if there exists a directory with the givenname.- Specified by:
hasDirectoryin interfaceDirectoryManager- Parameters:
name- the name of a directory.- Returns:
trueif the directory exists;falseotherwise.- Throws:
IOException- if an error occurs while looking up directories.
-
getDirectory
public Directory getDirectory(String name) throws IOException
Gets the directory with the givenname. If the directory does not yet exist then it will be created.- Specified by:
getDirectoryin interfaceDirectoryManager- Parameters:
name- the name of a directory.- Returns:
- the directory.
- Throws:
IOException- if an error occurs while getting or creating the directory.
-
getDirectoryNames
public String[] getDirectoryNames() throws IOException
Returns the names of the currently available directories.- Specified by:
getDirectoryNamesin interfaceDirectoryManager- Returns:
- names of the currently available directories.
- Throws:
IOException- if an error occurs while retrieving the directory names.
-
delete
public boolean delete(String name)
Deletes the directory with the given name.- Specified by:
deletein interfaceDirectoryManager- Parameters:
name- the name of the directory to delete.- Returns:
trueif the directory could be deleted successfully,falseotherwise. This method also returnsfalsewhen the directory with the givennamedoes not exist.
-
rename
public boolean rename(String from, String to)
Renames a directory.- Specified by:
renamein interfaceDirectoryManager- Parameters:
from- the name of the directory to rename.to- the new name for the directory.- Returns:
trueif the directory was successfully renamed. Returnsfalseif there is no directory with namefromor there already exists a directory with nametoor an error occurs while renaming the directory.
-
dispose
public void dispose()
Frees resources associated with this directory manager.- Specified by:
disposein interfaceDirectoryManager
-
-