This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Hello, I am working on URLyBird and have a question about how to change the path of the properties file. I have a class that handles the properties in the suncertify.client package and I use "System.getProperty("user.dir")" function to get the path. The thing is that I have to save the properties file in the current working directory, which is 2 directories above suncertify/client directory. I was thinking of doing like this:
I wrote "\\suncertify\\client", because I am sure that the ending directory would like this. But I am not sure whether this would also work on Linux. I belive it would work since the only difference is that Linux uses "/" instead of "\". (Please correct me if I am wrong) Is there a better way of doing this or would this be ok? Kim
Hi Kim, regarding properties file I think what they mean by it is this. Our application is sent as an executable jar to them. So no matter where they run the application, the application should create a properties file in that particular directory and use it. I think that is what they mean from this "properties file should be in the current working directory". This you can do in the way you said as getProperty("user.dir"). Good Luck.
Hi Kim, I confirm what Satish wrote above. System.getProperty("user.dir") returns the directory where the JVM was started. It can be or not the directory where your executable jar file resides, but it's what SUN means in our instructions by "current working directory". Regards, Phil.
Joined: Jan 07, 2004
Hi Satish & Phil, Hope I am getting it right. So System.getProperty("user.dir") gives me the path of the directory in which I execute the program instead of the path of the class which uses this function, because as Phil wrote, System.getProperty("user.dir") returns the directory where the JVM was started. Am I correct? Kim
Joined: Jun 02, 2003
subject: NX: How to locate "suncerity.properties" in the current working directory?