You're looking for a resource which is relative to the LogUtils
class.
You could use getClass().getResource("/logs")
or you could use getClass().getClassLoader().getResource("logs")
.
(In either case, I'm not 100% convinced it'll work when that's a folder rather than an actual resource...)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.