I'm trying to use openwhisk cloud functions to leverage some existing java code. The code needs to read a local file. Is this supported in a Java Action on IBM Cloud? Though the file is included in the jar file - the application is not able to reach the file .
1 Answers
0
votes
OpenWhisk actions can read from the file system. Changes to the runtime filesystem are not persisted across invocations.
If you want to include a file within the JAR, you will need to need to find the location of the JAR within the filesystem, unzip it and read the file contents.
The Java runtime stores the user-provided JAR in the system-wide temporary directory as useraction.jar.
Another approach would be to store the file on an object storage service and retrieve it dynamically during invocations.