Class ForkedCLIUtil


  • public class ForkedCLIUtil
    extends Object
    A utility for forking a CLI process.
    Author:
    jdenise, James R. Perkins
    • Constructor Detail

      • ForkedCLIUtil

        public ForkedCLIUtil()
    • Method Detail

      • fork

        public static void fork​(String[] artifacts,
                                Class<?> clazz,
                                Path home,
                                Path output,
                                String... args)
                         throws IOException
        Forks a CLI process.
        Parameters:
        artifacts - the artifacts to add to the class path
        clazz - the class to invoke
        home - the home directory, this is always the first argument
        output - the path to the output file for the process
        args - any additional arguments to send add to the call
        Throws:
        IOException - if an error occurs create the process
      • fork

        public static void fork​(Collection<String> artifacts,
                                Class<?> clazz,
                                Path home,
                                Path output,
                                String... args)
                         throws IOException
        Forks a CLI process.
        Parameters:
        artifacts - the artifacts to add to the class path
        clazz - the class to invoke
        home - the home directory, this is always the first argument
        output - the path to the output file for the process
        args - any additional arguments to send add to the call
        Throws:
        IOException - if an error occurs create the process