Reading file from external shared location
I am trying to read file from a shared location. The filepath is a UNC- "\\server\folder\file.xml".
I need to read this in java code.
Our Pega server is installed on linux. So I converted the \ to /.
When I use the PRFile api, and provide filepath as "file://server/folder/file.xml", file.exists() returns false and
file.getAbsolutePath() returns "file://default:/server/folder/file.xml".
Passing fileName without "file://" returns the same thing.
So I tried java.io.File. to this I passed URI(filePath) but I am still getting the same results, absoluteFilePath is /server/folder/file.xml and .exists() returns false.
I can access the files in eclipse on my windows machine with java File class.
Can anyone help with this?
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
This is fixed by mounting the external network location on server. We can set path to a folder on server which points to external location and we can read files.
Keep up to date on this post and subscribe to comments
- How to read PDF file from shared location and attach to WO
- Read Image from External Location through activity and convert it to Byte64- Not File Listener
- Unable to connect external source location from File listener source location
- File listener is not connecting to source location if it is shared drive.
- Need to generate Excel file from Report Definition and save into shared location (it shoud not popup for download) and Send as mail also?