Package org.apache.lucene.util
Class CommandLineUtil
java.lang.Object
org.apache.lucene.util.CommandLineUtil
Class containing some useful methods used by command line tools
- 
Method SummaryModifier and TypeMethodDescriptionloadDirectoryClass(String clazzName) Loads a specific Directory implementationstatic Class<? extends FSDirectory>loadFSDirectoryClass(String clazzName) Loads a specific FSDirectory implementationstatic FSDirectorynewFSDirectory(Class<? extends FSDirectory> clazz, File file) Creates a new specific FSDirectory instancestatic FSDirectorynewFSDirectory(String clazzName, File file) Creates a specific FSDirectory instance starting from its class name
- 
Method Details- 
newFSDirectoryCreates a specific FSDirectory instance starting from its class name- Parameters:
- clazzName- The name of the FSDirectory class to load
- file- The file to be used as parameter constructor
- Returns:
- the new FSDirectory instance
 
- 
loadDirectoryClasspublic static Class<? extends Directory> loadDirectoryClass(String clazzName) throws ClassNotFoundException Loads a specific Directory implementation- Parameters:
- clazzName- The name of the Directory class to load
- Returns:
- The Directory class loaded
- Throws:
- ClassNotFoundException- If the specified class cannot be found.
 
- 
loadFSDirectoryClasspublic static Class<? extends FSDirectory> loadFSDirectoryClass(String clazzName) throws ClassNotFoundException Loads a specific FSDirectory implementation- Parameters:
- clazzName- The name of the FSDirectory class to load
- Returns:
- The FSDirectory class loaded
- Throws:
- ClassNotFoundException- If the specified class cannot be found.
 
- 
newFSDirectorypublic static FSDirectory newFSDirectory(Class<? extends FSDirectory> clazz, File file) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Creates a new specific FSDirectory instance- Parameters:
- clazz- The class of the object to be created
- file- The file to be used as parameter constructor
- Returns:
- The new FSDirectory instance
- Throws:
- NoSuchMethodException- If the Directory does not have a constructor that takes- File.
- InstantiationException- If the class is abstract or an interface.
- IllegalAccessException- If the constructor does not have public visibility.
- InvocationTargetException- If the constructor throws an exception
 
 
-