| | |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | |
| | | /** |
| | | * @Description 读取Properties的工具类 |
| | | */ |
| | |
| | | } else { |
| | | sysName += ".properties"; |
| | | }*/ |
| | | InputStream is=null; |
| | | try { |
| | | propertiesShiro.load(PropertiesUtil.class.getClassLoader() |
| | | .getResourceAsStream("config/authentication.properties")); |
| | | is=PropertiesUtil.class.getClassLoader() |
| | | .getResourceAsStream("config/authentication.properties"); |
| | | propertiesShiro.load(is); |
| | | } catch (Exception e) { |
| | | log.warn("资源路径中不存在authentication.properties权限文件,忽略读取!"); |
| | | }finally { |
| | | if(is!=null){ |
| | | try { |
| | | is.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |