How to get the path of the application data folder ?

Posted on 2007-07-30
Last Modified: 2012-05-05

I'd like to know if it is possible to get the path, in java, of application data folder?
The result must be C:\Documents and Settings\...\Application Data


Question by:pofpof98
    LVL 23

    Accepted Solution

    Use this:

    String dataFolder = System.getProperty("user.home") + File.separator + "Application Data";
    LVL 92

    Assisted Solution

    or u can use File class:

    File appData = new File(System.getProperty("user.home"), "Application Data");
    LVL 2

    Expert Comment

    IMHO the correct answer is

    Of course, this is windoze specific, but it seems an installation may choose to keep appdata in a directory that is not System.getProperty("user.home") + File.separator + "Application Data".

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now