---
title: "现有web系统替换成Spring Boot2框架 之18 本地文件读取"
author: "sanry"
date: "2019-03-05T16:58:32Z"
tags: []
categories: ["编程语言"]
slug: "web-spring-boot2-18"
draft: false
lastmod: "2019-03-05T16:58:31Z"
id: 2437846
url: "https://sanry.iteye.com/blog/2437846"
---

LicenseManage.**class**.getClassLoader().getResource("/").getPath();

spring boot中此方法无法获取文件路径

代码中LicenseManage.**class**.getClassLoader().getResource("/")去掉“/”，改成LicenseManage.**class**.getClassLoader().getResource("")