class ProcessUtil {

    @Deprecated
    public static int getCommandExitValue( final List<String> cmdWithArgs )
    {

        if ( cmdWithArgs != null )
        {

            int cmdsLength = cmdWithArgs.size();
            if ( cmdsLength > 0 )
            {

                String cmd = ProcessUtil.getCommand( cmdWithArgs );
                cmd = maskPassword( cmd );
                final Process process = ProcessUtil.execute( cmdWithArgs );
                if ( process != null )
                {
                    int processId = ProcessUtil.getProcessId( process );
                    if ( processId != -1 )
                    {
                        logger.debug( "Command '{}' running as Process: '{}'.", cmd, processId );
                    }
                    try
                    {

                        logger.info( "Waiting for the command '{}' execution.", cmd );
                        int status = process.waitFor();
                        extractOutput( process );
                        extractException( process );

                        return status;
                    }
                    catch ( InterruptedException e )
                    {
                        logger.error( "Error while waiting for the command '{}' execution, exception: {}", cmd, e );
                    }
                }
            }
        }
        return -1;
    }

    private  ProcessUtil();

}