|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.solr.core.DirectoryFactory
public abstract class DirectoryFactory
Provides access to a Directory implementation. You must release every Directory that you get.
| Nested Class Summary | |
|---|---|
static class |
DirectoryFactory.DirContext
|
| Field Summary | |
|---|---|
static IOContext |
IOCONTEXT_NO_CACHE
|
| Constructor Summary | |
|---|---|
DirectoryFactory()
|
|
| Method Summary | |
|---|---|
abstract void |
addCloseListener(Directory dir,
CachingDirectoryFactory.CloseListener closeListener)
Adds a close listener for a Directory. |
abstract void |
close()
Close the this and all of the Directories it contains. |
protected abstract Directory |
create(String path,
DirectoryFactory.DirContext dirContext)
Creates a new Directory for a given path. |
abstract void |
doneWithDirectory(Directory directory)
Indicates a Directory will no longer be used, and when it's ref count hits 0, it can be closed. |
static boolean |
empty(Directory dir)
Delete the files in the Directory |
abstract boolean |
exists(String path)
Returns true if a Directory exists for a given path. |
abstract Directory |
get(String path,
DirectoryFactory.DirContext dirContext,
String rawLockType)
Returns the Directory for a given path, using the specified rawLockType. |
abstract void |
incRef(Directory directory)
Increment the number of references to the given Directory. |
boolean |
isAbsolute(String path)
|
abstract boolean |
isPersistent()
|
void |
move(Directory fromDir,
Directory toDir,
String fileName,
IOContext ioContext)
Override for more efficient moves. |
String |
normalize(String path)
Normalize a given path. |
abstract void |
release(Directory directory)
Releases the Directory so that it may be closed when it is no longer referenced. |
abstract void |
remove(Directory dir)
Removes the Directory's persistent storage. |
abstract void |
remove(Directory dir,
boolean afterCoreClose)
Removes the Directory's persistent storage. |
abstract void |
remove(String path)
This remove is special in that it may be called even after the factory has been closed. |
abstract void |
remove(String path,
boolean afterCoreClose)
This remove is special in that it may be called even after the factory has been closed. |
static long |
sizeOf(Directory directory,
String file)
|
static long |
sizeOfDirectory(Directory directory)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin |
|---|
init |
| Field Detail |
|---|
public static final IOContext IOCONTEXT_NO_CACHE
| Constructor Detail |
|---|
public DirectoryFactory()
| Method Detail |
|---|
public abstract void doneWithDirectory(Directory directory)
throws IOException
IOException - If there is a low-level I/O error.
public abstract void addCloseListener(Directory dir,
CachingDirectoryFactory.CloseListener closeListener)
public abstract void close()
throws IOException
close in interface CloseableIOException - If there is a low-level I/O error.
protected abstract Directory create(String path,
DirectoryFactory.DirContext dirContext)
throws IOException
IOException - If there is a low-level I/O error.
public abstract boolean exists(String path)
throws IOException
IOException - If there is a low-level I/O error.
public abstract void remove(Directory dir)
throws IOException
IOException - If there is a low-level I/O error.
public abstract void remove(Directory dir,
boolean afterCoreClose)
throws IOException
IOException - If there is a low-level I/O error.
public abstract void remove(String path,
boolean afterCoreClose)
throws IOException
path - to removeafterCoreClose - whether to wait until after the core is closed.
IOException - If there is a low-level I/O error.
public abstract void remove(String path)
throws IOException
path - to remove
IOException - If there is a low-level I/O error.
public void move(Directory fromDir,
Directory toDir,
String fileName,
IOContext ioContext)
throws IOException
IOException - If there is a low-level I/O error.
public abstract Directory get(String path,
DirectoryFactory.DirContext dirContext,
String rawLockType)
throws IOException
IOException - If there is a low-level I/O error.public abstract void incRef(Directory directory)
public abstract boolean isPersistent()
public abstract void release(Directory directory)
throws IOException
IOException - If there is a low-level I/O error.
public String normalize(String path)
throws IOException
path - to normalize
IOException - on io errorpublic boolean isAbsolute(String path)
path - the path to check
public static long sizeOfDirectory(Directory directory)
throws IOException
IOException
public static long sizeOf(Directory directory,
String file)
throws IOException
IOExceptionpublic static boolean empty(Directory dir)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||