I came across System.getProperty("user.home")
and System.getProperty("user.dir")
in java, but those are returning paths from the server.
I have an applet and want to create a folder based on the user directory on the client, is there any way to get that information?
I solved this by placing the following code inside jar file and sign the jar
import java.applet.Applet;
import java.security.AccessController;
import java.security.PrivilegedAction;
public class UserHomeApplet
extends Applet
{
private static final long serialVersionUID = 1L;
public String getUserHome()
{
AccessController.doPrivileged(new PrivilegedAction()
{
public Object run()
{
return System.getProperty("user.home");
}
}).toString();
}
}