package com.iplatform.recvideo.util;
|
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.core.io.DefaultResourceLoader;
|
import org.springframework.core.io.ResourceLoader;
|
|
import java.io.IOException;
|
import java.io.InputStream;
|
import java.util.Properties;
|
|
public class CommonUtil {
|
private static transient Logger log = LoggerFactory.getLogger(CommonUtil.class);
|
|
/**
|
* @Author : liu.q [916000612@qq.com]
|
* @少时狂发编程想,无谓赴身IT行. @纵使荣华未可进,我自coding又何妨!
|
* @Time 2020/2/25 3:55 下午
|
* @Description : 获取资源文件
|
*/
|
public static Properties getProp(String fileName) {
|
Properties props = new Properties();
|
ResourceLoader resourceLoader = new DefaultResourceLoader();
|
try {
|
InputStream in = resourceLoader.getResource(fileName).getInputStream();
|
props.load(in);
|
} catch (IOException e) {
|
log.error(e.getMessage());
|
}
|
return props;
|
}
|
}
|