Reputation: 1626
I'm trying to open a file from Java in Ubuntu using FileInputStream.Now my problem is,how can i find the path of the current user as /home/"currentuser"/myfile.xxx
?? Normally i use the path as a string since i know the current user.
Regards.
Upvotes: 0
Views: 79
Reputation: 5603
The user's home directory can be retrieved via
String userHomeDir = System.getProperty("user.home");
Upvotes: 4