Question

5
Replies
3419
Views
Akash Member since 2017 12 posts
Vodafone
Posted: 2 years ago
Last activity: 2 years 8 months ago
Closed
Solved

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?

Data Integration Java and Activities
Moderation Team has archived post
Share this page LinkedIn