I need to pass the file path to a function of an external class which uses it in the following way:
byte[] keyBytes = Files.readAllBytes((new File(pathname)).toPath());
The class cannot be edited otherwise I would have used this method to read the file ->
InputStream inputStream = getClass().getResourceAsStream("/file_name.xyz");
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
When running the code locally, it's able to retrieve the file but when the JAR is deployed on cloud it's failing to find it.
Currently I have pasted the file at src/main/resources
but I can shift it to any other folder also. Just need to pass the path so that the function reads it.
Can someone help me with this? I'm stuck on it from couple of days