public class FilterDirectory extends Directory
Directory implementation such as
rate limiting or to add additional
sanity checks for tests. However, if you plan to write your own
Directory implementation, you should consider extending directly
Directory or BaseDirectory rather than try to reuse
functionality of existing Directorys by extending this class.Directory.IndexInputSlicer| Modifier and Type | Method and Description |
|---|---|
void |
clearLock(java.lang.String name)
Attempt to clear (forcefully unlock and remove) the
specified lock.
|
void |
close()
Closes the store.
|
IndexOutput |
createOutput(java.lang.String name,
IOContext context)
Creates a new, empty file in the directory with the given name.
|
void |
deleteFile(java.lang.String name)
Removes an existing file in the directory.
|
boolean |
fileExists(java.lang.String name)
Returns true iff a file with the given name exists.
|
long |
fileLength(java.lang.String name)
Returns the length of a file in the directory.
|
Directory |
getDelegate()
Return the wrapped
Directory. |
LockFactory |
getLockFactory()
Get the LockFactory that this Directory instance is
using for its locking implementation.
|
java.lang.String |
getLockID()
Return a string identifier that uniquely differentiates
this Directory instance from other Directory instances.
|
java.lang.String[] |
listAll()
Returns an array of strings, one for each file in the directory.
|
Lock |
makeLock(java.lang.String name)
Construct a
Lock. |
IndexInput |
openInput(java.lang.String name,
IOContext context)
Returns a stream reading an existing file, with the
specified read buffer size.
|
void |
setLockFactory(LockFactory lockFactory)
Set the LockFactory that this Directory instance should
use for its locking implementation.
|
void |
sync(java.util.Collection<java.lang.String> names)
Ensure that any writes to these files are moved to
stable storage.
|
java.lang.String |
toString() |
copy, createSlicerpublic java.lang.String[] listAll()
throws java.io.IOException
DirectorylistAll in class DirectoryNoSuchDirectoryException - if the directory is not prepared for any
write operations (such as Directory.createOutput(String, IOContext)).java.io.IOException - in case of other IO errorspublic boolean fileExists(java.lang.String name)
throws java.io.IOException
DirectoryfileExists in class Directoryjava.io.IOExceptionpublic void deleteFile(java.lang.String name)
throws java.io.IOException
DirectorydeleteFile in class Directoryjava.io.IOExceptionpublic long fileLength(java.lang.String name)
throws java.io.IOException
DirectoryFileNotFoundException if the file does not exist
(not java.nio.file.NoSuchFileException of Java 7).
fileLength in class Directoryname - the name of the file for which to return the length.java.io.IOException - if there was an IO error while retrieving the file's
length.public IndexOutput createOutput(java.lang.String name, IOContext context) throws java.io.IOException
DirectorycreateOutput in class Directoryjava.io.IOExceptionpublic void sync(java.util.Collection<java.lang.String> names)
throws java.io.IOException
Directorypublic IndexInput openInput(java.lang.String name, IOContext context) throws java.io.IOException
DirectoryFSDirectory and CompoundFileDirectory.
FileNotFoundException if the file does not exist
(not java.nio.file.NoSuchFileException of Java 7).public Lock makeLock(java.lang.String name)
DirectoryLock.public void clearLock(java.lang.String name)
throws java.io.IOException
Directorypublic void close()
throws java.io.IOException
Directorypublic void setLockFactory(LockFactory lockFactory) throws java.io.IOException
DirectorysetLockFactory in class DirectorylockFactory - instance of LockFactory.java.io.IOExceptionpublic java.lang.String getLockID()
Directorypublic LockFactory getLockFactory()
DirectorygetLockFactory in class DirectoryCopyright © 2010 - 2024 Adobe. All Rights Reserved