Thanks all for the suggestions. I've tried the above approaches but it wasn't working for me and after some research on the generated-package in /var, I found the paths are stored under contentRootPaths. So the below code snippet gets the whole path for me.
workItem.getWorkflowData().getMetaDataMap...