I'am trying to get the workspace folder (C:/...) from a jsf application. I tried system.getproperty( user.dir ) but it returns the deployment of my server ( D:...\jboss-as-7.1.0.Final\jboss-as-7.1.0.Final\standalone\deployments\myProject) when i execute system.getproperty( user.dir ) as java application in public static void main method it returns the right path. Please is there any way to get my work space path ? Thank you
Asked
Active
Viewed 39 times
0
-
1"user.dir" returns the current working directory. If you want that to be "the right path" you have to `cd` there when running the application. – Thilo Apr 03 '16 at 10:38
-
I didn't really get your answer, I have to use the command line ? but I want to get the path dynamically – user3928031 Apr 03 '16 at 10:51
-
The problem is that my application can be installed in different machine with different workspace path, I need to be able to get the path to the project so that i could delete source file ( security measures ) if it was took by an unknown person – user3928031 Apr 03 '16 at 11:19
-
Why are you deploying source code on an untrusted machine? The simple answer is 'don't'. You should only be deploying compiled code. – user207421 Apr 03 '16 at 12:28
-
1Depending on what you [really](http://xyproblem.info) need to do, those should be helpful: http://stackoverflow.com/q/18664579, http://stackoverflow.com/q/4543936 and http://stackoverflow.com/q/2161054 – BalusC Apr 03 '16 at 15:21