Eclipse RCP: how do I get the path to the ini file?

I am developing an RCP Eclipse application, I will name it MyRcpApp. So, MyRcpApp will have the file MyRcpApp.ini, next to its launch MyRcpApp.exe.

Question: is it possible to get the full path to the ini file (for example, C: \ work \ MyRcpAppExported \ eclipse \ MyRcpApp.ini) from the MyRcpApp java code?

Thanks in advance, Sergey

+3
source share
1 answer

This should do the trick for you:

URL url = new URL(Platform.getInstallLocation().getURL()+Platform.getProduct().getName()+".ini");

Then just use url to access the contents of the file.

+6
source

Source: https://habr.com/ru/post/1768018/


All Articles