Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to get users home directory?

Reply
Thread Tools

How to get users home directory?

 
 
Bryan
Guest
Posts: n/a
 
      07-13-2007
Hi,

How in java do I find the users home directory? I have an app that
needs to write some files to the current users Documents and Settings
directory on XP.

Thanks,
Bryan
 
Reply With Quote
 
 
 
 
Carl
Guest
Posts: n/a
 
      07-13-2007
Bryan <(E-Mail Removed)> writes:

> Hi,
>
> How in java do I find the users home directory? I have an app that
> needs to write some files to the current users Documents and Settings
> directory on XP.
>
> Thanks,
> Bryan


Try:

String userHome = System.getProperty("user.home");

hope that helps,
Carl.
 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      07-13-2007

"Bryan" <(E-Mail Removed)> wrote in message
news:FhPli.6391$(E-Mail Removed) ...
> Hi,
>
> How in java do I find the users home directory? I have an app that
> needs to write some files to the current users Documents and Settings
> directory on XP.


Use system properties. A list of available properties are at:
http://www.mindspring.com/~mgrand/ja...properties.htm

- Oliver


 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-13-2007
On Fri, 13 Jul 2007 11:13:58 -0700, Bryan <(E-Mail Removed)> wrote,
quoted or indirectly quoted someone who said :

>How in java do I find the users home directory? I have an app that
>needs to write some files to the current users Documents and Settings
>directory on XP.


see http://mindprod.com/jgloss/properties.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to Synchronize anonymous users with authenticated users using profiles? Rodusa ASP .Net 2 09-08-2005 08:12 PM
Hi I have one web application and i want to get the number of users who are currently accessing the application. Also I want to get the user details of each user, which is stored in a database. How can I do this? Pls help. Getting No: and anu Java 11 05-12-2005 03:25 PM
Help me in making users/deleting users in active directory Sara rafiee ASP .Net 3 10-04-2004 01:35 PM



Advertisments