public class StandardDirectoryFactory extends CachingDirectoryFactory
FSDirectory
based behavior.
File based DirectoryFactory implementations generally extend
this class.CachingDirectoryFactory.CacheValue, CachingDirectoryFactory.CloseListener
DirectoryFactory.DirContext
byDirectoryCache, byPathCache, closeListeners
IOCONTEXT_NO_CACHE
Constructor and Description |
---|
StandardDirectoryFactory() |
Modifier and Type | Method and Description |
---|---|
protected Directory |
create(String path,
DirectoryFactory.DirContext dirContext)
Creates a new Directory for a given path.
|
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.
|
void |
remove(Directory dir)
Removes the Directory's persistent storage.
|
void |
remove(String path)
This remove is special in that it may be called even after
the factory has been closed.
|
addCloseListener, close, doneWithDirectory, exists, get, get, incRef, init, release
empty, sizeOf, sizeOfDirectory
protected Directory create(String path, DirectoryFactory.DirContext dirContext) throws IOException
DirectoryFactory
create
in class CachingDirectoryFactory
IOException
- If there is a low-level I/O error.public String normalize(String path) throws IOException
DirectoryFactory
normalize
in class DirectoryFactory
path
- to normalizeIOException
- on io errorpublic boolean isPersistent()
isPersistent
in class DirectoryFactory
public void remove(Directory dir) throws IOException
DirectoryFactory
remove
in class DirectoryFactory
IOException
- If there is a low-level I/O error.public void remove(String path) throws IOException
DirectoryFactory
remove
in class DirectoryFactory
path
- to removeIOException
- If there is a low-level I/O error.public void move(Directory fromDir, Directory toDir, String fileName, IOContext ioContext) throws IOException
Directory.sync(java.util.Collection)
any file that will be
moved or avoid cached files through settings.move
in class DirectoryFactory
IOException
- If there is a low-level I/O error.Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.