cy
2022-10-09 301017226e61aa39c8b40e780ca244eeddd073d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
    }
}