public final class CommandLineUtil extends Object
Modifier and Type | Method and Description |
---|---|
static Class<? extends Directory> |
loadDirectoryClass(String clazzName)
Loads a specific Directory implementation
|
static Class<? extends FSDirectory> |
loadFSDirectoryClass(String clazzName)
Loads a specific FSDirectory implementation
|
static FSDirectory |
newFSDirectory(Class<? extends FSDirectory> clazz,
Path path)
Creates a new specific FSDirectory instance
|
static FSDirectory |
newFSDirectory(Class<? extends FSDirectory> clazz,
Path path,
LockFactory lf)
Creates a new specific FSDirectory instance
|
static FSDirectory |
newFSDirectory(String clazzName,
Path path)
Creates a specific FSDirectory instance starting from its class name, using the default lock factory
|
static FSDirectory |
newFSDirectory(String clazzName,
Path path,
LockFactory lf)
Creates a specific FSDirectory instance starting from its class name
|
public static FSDirectory newFSDirectory(String clazzName, Path path)
clazzName
- The name of the FSDirectory class to loadpath
- The path to be used as parameter constructorpublic static FSDirectory newFSDirectory(String clazzName, 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 Class<? extends Directory> loadDirectoryClass(String clazzName) throws ClassNotFoundException
clazzName
- The name of the Directory class to loadClassNotFoundException
- If the specified class cannot be found.public static Class<? extends FSDirectory> loadFSDirectoryClass(String clazzName) throws ClassNotFoundException
clazzName
- The name of the FSDirectory class to loadClassNotFoundException
- If the specified class cannot be found.public static FSDirectory newFSDirectory(Class<? extends FSDirectory> clazz, Path path) throws ReflectiveOperationException
clazz
- The class of the object to be createdpath
- The file to be used as parameter constructorNoSuchMethodException
- If the Directory does not have a constructor that takes Path
.InstantiationException
- If the class is abstract or an interface.IllegalAccessException
- If the constructor does not have public visibility.InvocationTargetException
- If the constructor throws an exceptionReflectiveOperationException
public static FSDirectory newFSDirectory(Class<? extends FSDirectory> clazz, Path path, LockFactory lf) throws ReflectiveOperationException
clazz
- The class of the object to be createdpath
- The file to be used as parameter constructorlf
- The lock factory to be usedNoSuchMethodException
- If the Directory does not have a constructor that takes Path
.InstantiationException
- If the class is abstract or an interface.IllegalAccessException
- If the constructor does not have public visibility.InvocationTargetException
- If the constructor throws an exceptionReflectiveOperationException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.