public final class CommandLineUtil
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
CommandLineUtil() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
adjustDirectoryClassName(java.lang.String clazzName) |
static java.lang.Class<? extends Directory> |
loadDirectoryClass(java.lang.String clazzName)
Loads a specific Directory implementation
|
static java.lang.Class<? extends FSDirectory> |
loadFSDirectoryClass(java.lang.String clazzName)
Loads a specific FSDirectory implementation
|
static FSDirectory |
newFSDirectory(java.lang.Class<? extends FSDirectory> clazz,
java.nio.file.Path path)
Creates a new specific FSDirectory instance
|
static FSDirectory |
newFSDirectory(java.lang.Class<? extends FSDirectory> clazz,
java.nio.file.Path path,
LockFactory lf)
Creates a new specific FSDirectory instance
|
static FSDirectory |
newFSDirectory(java.lang.String clazzName,
java.nio.file.Path path)
Creates a specific FSDirectory instance starting from its class name, using the default lock factory
|
static FSDirectory |
newFSDirectory(java.lang.String clazzName,
java.nio.file.Path path,
LockFactory lf)
Creates a specific FSDirectory instance starting from its class name
|
public static FSDirectory newFSDirectory(java.lang.String clazzName, java.nio.file.Path path)
clazzName
- The name of the FSDirectory class to loadpath
- The path to be used as parameter constructorpublic static FSDirectory newFSDirectory(java.lang.String clazzName, java.nio.file.Path path, LockFactory lf)
clazzName
- The name of the FSDirectory class to loadpath
- The path to be used as parameter constructorlf
- The lock factory to be usedpublic static java.lang.Class<? extends Directory> loadDirectoryClass(java.lang.String clazzName) throws java.lang.ClassNotFoundException
clazzName
- The name of the Directory class to loadjava.lang.ClassNotFoundException
- If the specified class cannot be found.public static java.lang.Class<? extends FSDirectory> loadFSDirectoryClass(java.lang.String clazzName) throws java.lang.ClassNotFoundException
clazzName
- The name of the FSDirectory class to loadjava.lang.ClassNotFoundException
- If the specified class cannot be found.private static java.lang.String adjustDirectoryClassName(java.lang.String clazzName)
public static FSDirectory newFSDirectory(java.lang.Class<? extends FSDirectory> clazz, java.nio.file.Path path) throws java.lang.ReflectiveOperationException
clazz
- The class of the object to be createdpath
- The file to be used as parameter constructorjava.lang.NoSuchMethodException
- If the Directory does not have a constructor that takes Path
.java.lang.InstantiationException
- If the class is abstract or an interface.java.lang.IllegalAccessException
- If the constructor does not have public visibility.java.lang.reflect.InvocationTargetException
- If the constructor throws an exceptionjava.lang.ReflectiveOperationException
public static FSDirectory newFSDirectory(java.lang.Class<? extends FSDirectory> clazz, java.nio.file.Path path, LockFactory lf) throws java.lang.ReflectiveOperationException
clazz
- The class of the object to be createdpath
- The file to be used as parameter constructorlf
- The lock factory to be usedjava.lang.NoSuchMethodException
- If the Directory does not have a constructor that takes Path
.java.lang.InstantiationException
- If the class is abstract or an interface.java.lang.IllegalAccessException
- If the constructor does not have public visibility.java.lang.reflect.InvocationTargetException
- If the constructor throws an exceptionjava.lang.ReflectiveOperationException