Wrong file path while reading from UI

Atonal Wilson shared this question 12 months ago
Completed

I am using windows builder swing UI to get file path from the system using a Jfilechooser.This problem is discussed in the Uipath Certification. When I select file from Jfile chooser ,file path is shown as-

D:\Tool\BondTest2\xyz.properties

Thats why my java code is not able to read file because as per java syntax file file should be like

D:\\Tool\\BondTest2\\xyz.properties

I write below code for the same but its not working-

String filePath = fileChooser.getSelectedFile().toString();
filePath = filePath.replaceAll(Pattern.quote("'\'"), "\\");
System.out.println("change path=" + filePath);

But it's not working.Please suggest.

Replies (2)

photo
1

Hi Atonal Wilson

Thank you for reaching yellowfin support.

Is there a connection between this question and yellowfin Bi?

Regards

Siddhartha.

photo
1

Hi Atonal Wilson

This doesn't appear to be connected to our Yellowfin BI. I'll put this in the completed category for the time being.


Regards

Siddhartha

Leave a Comment
 
Attach a file