public final class DirectoryUtils
extends java.lang.Object
Directory
classes.Modifier and Type | Method and Description |
---|---|
static <T extends org.apache.lucene.store.Directory> |
getLeaf(org.apache.lucene.store.Directory dir,
java.lang.Class<T> targetClass)
Tries to extract the leaf of the
Directory if the directory is a FilterDirectory and cast
it to the given target class or returns null if the leaf is not assignable to the target class. |
static <T extends org.apache.lucene.store.Directory> |
getLeaf(org.apache.lucene.store.Directory dir,
java.lang.Class<T> targetClass,
T defaultValue)
Tries to extract the leaf of the
Directory if the directory is a FilterDirectory and cast
it to the given target class or returns the given default value, if the leaf is not assignable to the target class. |
public static <T extends org.apache.lucene.store.Directory> T getLeaf(org.apache.lucene.store.Directory dir, java.lang.Class<T> targetClass)
Directory
if the directory is a FilterDirectory
and cast
it to the given target class or returns null
if the leaf is not assignable to the target class.
If the given Directory
is a concrete directory it will treated as a leaf and the above applies.public static <T extends org.apache.lucene.store.Directory> T getLeaf(org.apache.lucene.store.Directory dir, java.lang.Class<T> targetClass, T defaultValue)
Directory
if the directory is a FilterDirectory
and cast
it to the given target class or returns the given default value, if the leaf is not assignable to the target class.
If the given Directory
is a concrete directory it will treated as a leaf and the above applies.