I am using Eclipse Luna RCP. In the code of my plugin, I want the path of my workspace. I have used the following code:

```
String basePath = this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();

```

This should give:

```
/home/esghsni/avroWorkspace/AvroDesigner

```

But it is give incorrect path which include path the directory where eclipse rcp is stored. 

I have checked all the related questions but none helped. I have also tried decoding the path returned (using `URLDecoder()`), but it gave some other path altogether.
Any kind of help would be appreciated. Thank you!!