StringUtils和IOUtils工具包的使用
加载apache的工具类
<dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.6</version> </dependency> import org.apache.commons.lang.StringUtils; if (!StringUtils.isEmpty(kylinConfHome)) { logger.info("Use KYLIN_CONF=" + kylinConfHome); return getKylinPropertiesFile(kylinConfHome); }
关闭流操作
<dependency> <groupId>commons-io</groupId> <artifac tId>commons-io</artifactId> <version>2.4</version> </dependency> FileInputStream fis = new FileInputStream(propFile); finally { IOUtils.closeQuietly(fis); }