Source:
public void execute() throws Exception { InputStream in = null; try { _dialog.setHost(_vds.getHostName()); _dialog.connect(); _messages.post( InstallerMessages.Severity.INFO, String.format( "Connected to host %1$s with SSH key fingerprint: %2$s", _vds.getHostName(), _dialog.getHostFingerprint() ) ); _dialog.authenticate(); String command = Config.<String> GetValue(ConfigValues.BootstrapCommand); command = command.replace( BOOTSTRAP_CUSTOM_ENVIRONMENT_PLACE_HOLDER, "" ); log.infoFormat( "Installation of {0}. Executing command via SSH {1} < {2}", _vds.getHostName(), command, s_deployPackage.getFileNoUse() ); in = new FileInputStream(s_deployPackage.getFile()); _dialog.executeCommand( this, command, new InputStream[] {in} ); if (_failException != null) { throw _failException; } if (_resultError) { throw new RuntimeException( "Installation failed, please refer to installation logs" ); } else if (_goingToReboot) { deployStatus = DeployStatus.Reboot; } else if (_installIncomplete) { deployStatus = DeployStatus.Incomplete; } else { deployStatus = DeployStatus.Complete; } } catch (TimeLimitExceededException e){ log.errorFormat( "Timeout during host {0} install", _vds.getHostName(), e ); _messages.post( InstallerMessages.Severity.ERROR, "Processing stopped due to timeout" ); deployStatus = DeployStatus.Failed; throw e; } catch(Exception e) { log.errorFormat( "Error during host {0} install", _vds.getHostName(), e ); deployStatus = DeployStatus.Failed; if (_failException == null) { throw e; } else { log.errorFormat( "Error during host {0} install, prefering first exception", _vds.getHostName(), _failException ); throw _failException; } } finally { if (in != null) { try { in.close(); } catch (IOException e) { log.error("Cannot close deploy package", e); } } } }

Target:
public void execute() throws Exception { InputStream in = null; try { _dialog.setHost(_vds.getHostName()); _dialog.connect(); _messages.post( InstallerMessages.Severity.INFO, String.format( "Connected to host %1$s with SSH key fingerprint: %2$s", _vds.getHostName(), _dialog.getHostFingerprint() ) ); _dialog.authenticate(); String command = Config.<String> GetValue(ConfigValues.BootstrapCommand); command = command.replace( BOOTSTRAP_CUSTOM_ENVIRONMENT_PLACE_HOLDER, "" ); log.infoFormat( "Installation of {0}. Executing command via SSH {1} < {2}", _vds.getHostName(), command, s_deployPackage.getFileNoUse() ); in = new FileInputStream(s_deployPackage.getFile()); _dialog.executeCommand( this, command, new InputStream[] {in} ); if (_failException != null) { throw _failException; } if (_resultError) { throw new RuntimeException( "Installation failed, please refer to installation logs" ); } else if (_goingToReboot) { deployStatus = DeployStatus.Reboot; } else if (_installIncomplete) { deployStatus = DeployStatus.Incomplete; } else { deployStatus = DeployStatus.Complete; } } catch (TimeLimitExceededException e){ log.errorFormat( "Timeout during host {0} install", _vds.getHostName(), e ); _messages.post( InstallerMessages.Severity.ERROR, "Processing stopped due to timeout" ); throw e; } catch(Exception e) { log.errorFormat( "Error during host {0} install", _vds.getHostName(), e ); if (_failException == null) { throw e; } else { log.errorFormat( "Error during host {0} install, prefering first exception", _vds.getHostName(), _failException ); throw _failException; } } finally { if (in != null) { try { in.close(); } catch (IOException e) { log.error("Cannot close deploy package", e); } } } }