public static JdbcConfiguration load(String filePath) { try { String realPath = PathUtil.getAbstractPath(filePath); logger.debug("Load file:{}", realPath); Properties properties = new Properties(); properties.load(new FileInputStream(realPath)); String url = properties.getProperty(URL_KEY); String username = properties.getProperty(USERNAME_KEY); String password = properties.getProperty(PASSWORD_KEY); return new JdbcConfiguration(url, username, password); } catch (IOException e) { logger.error(e.getMessage(), e); } return null; }
public static JdbcConfiguration load(String filePath) { try { String realPath = PathUtil.getAbstractPath(filePath); logger.debug("Load file:{}", realPath); Properties properties = new Properties(); properties.load(new FileInputStream(realPath)); String url = properties.getProperty(URL_KEY); String username = properties.getProperty(USERNAME_KEY); String password = properties.getProperty(PASSWORD_KEY); return new JdbcConfiguration(url, username, password); } catch (IOException e) { logger.error(e.getMessage(), e); } return null; }