Source:
public static void loadDbFacadeConfig() throws Exception { boolean configSucceeded = false; final String ENGINE_CONF_FILE = "/etc/ovirt-engine/engine.conf"; final String ON_START_CONNECTION_TIMEOUT = "OnStartConnectionTimeout"; final String CONNECTION_CHECK_INTERVAL = "ConnectionCheckInterval"; final String DEFAULT_TIMEOUT_VALUE = "300000"; final String DEFAULT_INTERVAL_VALUE = "5000"; InputStream inputStream = null; try { String onStartConnectionTimeout = null; String connectionCheckInterval = null; Properties props = new Properties(); if (new File(ENGINE_CONF_FILE).exists()) { inputStream = new FileInputStream(ENGINE_CONF_FILE); props.load(inputStream); onStartConnectionTimeout = props.getProperty(ON_START_CONNECTION_TIMEOUT); connectionCheckInterval = props.getProperty(CONNECTION_CHECK_INTERVAL); if (!validNumber(onStartConnectionTimeout)) { onStartConnectionTimeout = DEFAULT_TIMEOUT_VALUE; } if (!validNumber(connectionCheckInterval)) { connectionCheckInterval = DEFAULT_INTERVAL_VALUE; } } else { log.warn(String.format("%1$s file is not found. Please check your engine installation. " + "Default values will be used" , ENGINE_CONF_FILE)); onStartConnectionTimeout = DEFAULT_TIMEOUT_VALUE; connectionCheckInterval = DEFAULT_INTERVAL_VALUE; } dbFacade.setOnStartConnectionTimeout(Integer.parseInt(onStartConnectionTimeout)); dbFacade.setConnectionCheckInterval(Integer.parseInt(connectionCheckInterval)); configSucceeded = true; } catch (Exception ex) { log.error("Error in configuration of db facade " + ExceptionUtils.getMessage(ex)); } finally { if (!configSucceeded) { dbFacade.setOnStartConnectionTimeout(300000); dbFacade.setConnectionCheckInterval(1000); } if (inputStream != null) { inputStream.close(); } } }

Target:
public static void loadDbFacadeConfig() throws Exception { boolean configSucceeded = false; final String ENGINE_CONF_FILE = "/etc/ovirt-engine/engine.conf"; final String ON_START_CONNECTION_TIMEOUT = "OnStartConnectionTimeout"; final String CONNECTION_CHECK_INTERVAL = "ConnectionCheckInterval"; final String DEFAULT_TIMEOUT_VALUE = "300000"; final String DEFAULT_INTERVAL_VALUE = "5000"; InputStream inputStream = null; try { String onStartConnectionTimeout = null; String connectionCheckInterval = null; Properties props = new Properties(); File confFile = new File(ENGINE_CONF_FILE); if (confFile.exists()) { inputStream = new FileInputStream(confFile); props.load(inputStream); onStartConnectionTimeout = props.getProperty(ON_START_CONNECTION_TIMEOUT); connectionCheckInterval = props.getProperty(CONNECTION_CHECK_INTERVAL); if (!validNumber(onStartConnectionTimeout)) { onStartConnectionTimeout = DEFAULT_TIMEOUT_VALUE; } if (!validNumber(connectionCheckInterval)) { connectionCheckInterval = DEFAULT_INTERVAL_VALUE; } } else { log.warn(String.format("%1$s file is not found. Please check your engine installation. " + "Default values will be used" , ENGINE_CONF_FILE)); onStartConnectionTimeout = DEFAULT_TIMEOUT_VALUE; connectionCheckInterval = DEFAULT_INTERVAL_VALUE; } dbFacade.setOnStartConnectionTimeout(Integer.parseInt(onStartConnectionTimeout)); dbFacade.setConnectionCheckInterval(Integer.parseInt(connectionCheckInterval)); configSucceeded = true; } catch (Exception ex) { log.error("Error in configuration of db facade " + ExceptionUtils.getMessage(ex)); } finally { if (!configSucceeded) { dbFacade.setOnStartConnectionTimeout(300000); dbFacade.setConnectionCheckInterval(1000); } if (inputStream != null) { inputStream.close(); } } }