Package org.apache.lucene.util
Class CommandLineUtil
- java.lang.Object
-
- org.apache.lucene.util.CommandLineUtil
-
public final class CommandLineUtil extends java.lang.Object
Class containing some useful methods used by command line tools
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<? extends Directory>
loadDirectoryClass(java.lang.String clazzName)
Loads a specific Directory implementationstatic java.lang.Class<? extends FSDirectory>
loadFSDirectoryClass(java.lang.String clazzName)
Loads a specific FSDirectory implementationstatic FSDirectory
newFSDirectory(java.lang.Class<? extends FSDirectory> clazz, java.io.File file)
Creates a new specific FSDirectory instancestatic FSDirectory
newFSDirectory(java.lang.String clazzName, java.io.File file)
Creates a specific FSDirectory instance starting from its class name
-
-
-
Method Detail
-
newFSDirectory
public static FSDirectory newFSDirectory(java.lang.String clazzName, java.io.File file)
Creates a specific FSDirectory instance starting from its class name- Parameters:
clazzName
- The name of the FSDirectory class to loadfile
- The file to be used as parameter constructor- Returns:
- the new FSDirectory instance
-
loadDirectoryClass
public static java.lang.Class<? extends Directory> loadDirectoryClass(java.lang.String clazzName) throws java.lang.ClassNotFoundException
Loads a specific Directory implementation- Parameters:
clazzName
- The name of the Directory class to load- Returns:
- The Directory class loaded
- Throws:
java.lang.ClassNotFoundException
- If the specified class cannot be found.
-
loadFSDirectoryClass
public static java.lang.Class<? extends FSDirectory> loadFSDirectoryClass(java.lang.String clazzName) throws java.lang.ClassNotFoundException
Loads a specific FSDirectory implementation- Parameters:
clazzName
- The name of the FSDirectory class to load- Returns:
- The FSDirectory class loaded
- Throws:
java.lang.ClassNotFoundException
- If the specified class cannot be found.
-
newFSDirectory
public static FSDirectory newFSDirectory(java.lang.Class<? extends FSDirectory> clazz, java.io.File file) throws java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
Creates a new specific FSDirectory instance- Parameters:
clazz
- The class of the object to be createdfile
- The file to be used as parameter constructor- Returns:
- The new FSDirectory instance
- Throws:
java.lang.NoSuchMethodException
- If the Directory does not have a constructor that takesFile
.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 exception
-
-