public static String runCommand()

in src/main/java/com/amazon/inspector/jenkins/amazoninspectorbuildstep/sbomgen/SbomgenUtils.java [58:76]


    public static String runCommand(String[] commandList, Launcher launcher, Map<String, String> env) throws SbomgenNotFoundException, UnsupportedEncodingException {
        ArgumentListBuilder command = new ArgumentListBuilder();
        command.add(commandList);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        Launcher.ProcStarter ps = launcher.new ProcStarter().stdout(baos).cmds(command);

        ps.envs(env);
        try {
            Proc proc = launcher.launch(ps);
            proc.join();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        return new String(baos.toByteArray(), "UTF-8");
    }