Using Java System Class, You can easily retrieve My Documents path in Java
Retrieve My Documents path in Java :
String temp = ((System.getenv("USERPROFILE"))+("\\My Documents\\"));
Output : C:\Users\user\My Documents\
File f1 = new JFileChooser().getFileSystemView().getDefaultDirectory();
Output : C:\Users\user\Documents
System.getProperty("user.home")
Output : C:\Users\user
Retrieve My Documents path in Java :
String temp = ((System.getenv("USERPROFILE"))+("\\My Documents\\"));
Output : C:\Users\user\My Documents\
File f1 = new JFileChooser().getFileSystemView().getDefaultDirectory();
Output : C:\Users\user\Documents
System.getProperty("user.home")
Output : C:\Users\user
No comments:
Post a Comment