I am trying to read a file from resource directory using below code
new FileInputStream(new File(getClass().getClassLoader().getResource(keyFile).getFile()))
getting below exception at runtime
java.io.FileNotFoundException: file:\D:\WorkSpace\server\target\server.jar!\BOOT-INF\classes!\config\key.pgp (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.(Unknown Source)