Class CommandLineUtil


  • public final class CommandLineUtil
    extends Object
    Class containing some useful methods used by command line tools
    • Method Detail

      • newFSDirectory

        public static FSDirectory newFSDirectory​(String clazzName,
                                                 Path path)
        Creates a specific FSDirectory instance starting from its class name, using the default lock factory
        Parameters:
        clazzName - The name of the FSDirectory class to load
        path - The path to be used as parameter constructor
        Returns:
        the new FSDirectory instance
      • newFSDirectory

        public static FSDirectory newFSDirectory​(String clazzName,
                                                 Path path,
                                                 LockFactory lf)
        Creates a specific FSDirectory instance starting from its class name
        Parameters:
        clazzName - The name of the FSDirectory class to load
        path - The path to be used as parameter constructor
        lf - The lock factory to be used
        Returns:
        the new FSDirectory instance
      • loadDirectoryClass

        public 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.
      • loadFSDirectoryClass

        public 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.