@Test( expected = IOException.class ) public void testInvalidCommand() throws Exception { ProgramUtils.executeCommand( Logger.getLogger( getClass().getName()), Arrays.asList( "whatever" ), null, null, null, null); }
public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResult( logger, command, workingDir, environmentVars, applicationName, scopedInstancePath); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); return result.getExitValue(); }
ProgramUtils { public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResult( logger, command, workingDir, environmentVars, applicationName, scopedInstancePath); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); return result.getExitValue(); } }
ProgramUtils { public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResult( logger, command, workingDir, environmentVars, applicationName, scopedInstancePath); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); return result.getExitValue(); } private  ProgramUtils(); }
ProgramUtils { public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResult( logger, command, workingDir, environmentVars, applicationName, scopedInstancePath); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); return result.getExitValue(); } private  ProgramUtils(); static ExecutionResult executeCommandWithResult(
			final Logger logger,
			final String[] command,
			final File workingDir,
			final Map<String,String> environmentVars,
			final String applicationName,
			final String scopedInstancePath); static int executeCommand(
			final Logger logger,
			final String[] command,
			final File workingDir,
			final Map<String,String> environmentVars,
			final String applicationName,
			final String scopedInstancePath); static int executeCommand(
			final Logger logger,
			final List<String> command,
			final File workingDir,
			final Map<String,String> environmentVars,
			final String applicationName,
			final String scopedInstanceName); }
ProgramUtils { public static int executeCommand( final Logger logger, final String[] command, final File workingDir, final Map<String,String> environmentVars, final String applicationName, final String scopedInstancePath) throws IOException, InterruptedException { ExecutionResult result = executeCommandWithResult( logger, command, workingDir, environmentVars, applicationName, scopedInstancePath); if( ! Utils.isEmptyOrWhitespaces( result.getNormalOutput())) logger.fine( result.getNormalOutput()); if( ! Utils.isEmptyOrWhitespaces( result.getErrorOutput())) logger.warning( result.getErrorOutput()); return result.getExitValue(); } private  ProgramUtils(); static ExecutionResult executeCommandWithResult(
			final Logger logger,
			final String[] command,
			final File workingDir,
			final Map<String,String> environmentVars,
			final String applicationName,
			final String scopedInstancePath); static int executeCommand(
			final Logger logger,
			final String[] command,
			final File workingDir,
			final Map<String,String> environmentVars,
			final String applicationName,
			final String scopedInstancePath); static int executeCommand(
			final Logger logger,
			final List<String> command,
			final File workingDir,
			final Map<String,String> environmentVars,
			final String applicationName,
			final String scopedInstanceName);  }