views:

33

answers:

2

I have an applet (java) that writes some files to the client file system. In Chrome and IE work perfectly and firefox too, only if I run it with Administrator permissions . (righ click -> Run as administrator). This solution don't look proper for a enterprise application.

By the way the applet is part of a big enterprise web application. So I don't have the security that the clients will be able to run firefox as administrator.

+1  A: 

Can it be that it's Firefox itself that doesn't have permissions to write where you want it to write to?

Eugene Mayevski 'EldoS Corp
umm no.. I don't think so. I'm writing in ".", inside the firefox, inside the user's firefox local data. This is the place where I have the security that the applet wiil be able to write. In other part of the file system I don't not sure of the permissions.
oracleruiz
I'd say that "." is very likely candidate to a problem cause. Microsoft warns against using the concept of current directory for multithreaded applications, especially heavily multithreaded ones. So I guess this *is* the problem. For testing purposes you can use the absolute path, to which you surely know Firefox has access to (something like c:\temp). This way you'll narrow down the problem.
Eugene Mayevski 'EldoS Corp
+1  A: 

A good place to store application data is in a sub-directory of user.home. Use a sub-directory based on the package name of the main class, to help avoid your 'settings.dat' colliding with our 'settings.dat'!


To make it even more 'Windows friendly' (when the relevant property indicates Win. of course!) the root directory for settings for any Java app. might be ${user.home}/AppData/Local/Java/

Andrew Thompson
Thank you for the idea. The code in Java is: System.getProperty("user.home") to get the path to the user home directory. See ya!
oracleruiz