java.nio.file.FileSystemNotFoundException when getting file from resources folder

前端 未结 5 1726
野的像风
野的像风 2021-01-04 11:58

I am getting this error on the following code (note that this does not happen on my local machine, only on my build server):

Files.readAllBytes(Paths.get(get         


        
5条回答
  •  礼貌的吻别
    2021-01-04 12:22

    You should be using getResourceAsStream(…) instead of getResource(…). There are a number of methods to read all bytes into a byte array, e.g. Apache Commons has a utility method to do just that.

提交回复
热议问题