public class RAMDirectoryManager extends Object implements DirectoryManager
RAMDirectoryManager implements a directory manager for
RAMDirectory instances.| Constructor and Description |
|---|
RAMDirectoryManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(String name)
Deletes the directory with the given name.
|
void |
dispose()
Frees resources associated with this directory manager.
|
org.apache.lucene.store.Directory |
getDirectory(String name)
Gets the directory with the given
name. |
String[] |
getDirectoryNames()
Returns the names of the currently available directories.
|
boolean |
hasDirectory(String name)
Checks if there exists a directory with the given
name. |
void |
init(SearchIndex handler)
Initializes the directory manager with a reference to the search index.
|
boolean |
rename(String from,
String to)
Renames a directory.
|
public void init(SearchIndex handler) throws IOException
init in interface DirectoryManagerhandler - the query handler implementation.IOException - if an error occurs while initializing the directory
manager.public boolean hasDirectory(String name) throws IOException
name.hasDirectory in interface DirectoryManagername - the name of a directory.true if the directory exists; false
otherwise.IOException - if an error occurs while looking up directories.public org.apache.lucene.store.Directory getDirectory(String name)
name. If the directory
does not yet exist then it will be created.getDirectory in interface DirectoryManagername - the name of a directory.public String[] getDirectoryNames() throws IOException
getDirectoryNames in interface DirectoryManagerIOException - if an error occurs while retrieving the directory
names.public boolean delete(String name)
delete in interface DirectoryManagername - the name of the directory to delete.true if the directory could be deleted successfully,
false otherwise. This method also returns
false when the directory with the given
name does not exist.public boolean rename(String from, String to)
rename in interface DirectoryManagerfrom - the name of the directory to rename.to - the new name for the directory.true if the directory was successfully renamed.
Returns false if there is no directory with name
from or there already exists a directory with name
to or an error occurs while renaming the directory.public void dispose()
dispose in interface DirectoryManagerCopyright © 2004–2022 The Apache Software Foundation. All rights reserved.