Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8024029

Need a method to query app data directory


    • Type: Enhancement
    • Status: Open
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd_major
    • Component/s: other-libs
    • Labels:


      Applications may want to store some configuration data in the user profile. Often there are standard locations for storing such data, e.g.:

      * *NIX: $HOME/.<app_name>
      * Mac: $HOME/Library/Application Support/<app_name>
      * Windows: %HOME%\AppData\Roaming\<app_name>

      where the <app_name> represents an app-defined name of the application.

      This is a request to introduce something like the following in JDK:

         public static Path java.nio.file.Files.getAppDataPath(String appName);

      that would return a Path object pointing to a directory where the app may store its data. The directory may not exist yet, and it is the responsibility of the app (not JDK) to create it if needed.

      Note: in the future we may want to handle the Roaming vs. Local cases (either with a boolean argument for this method, or as a separate API call). However, currently this isn't a requirement.

      This API is requested by JavaFX Web component. See https://javafx-jira.kenai.com/browse/RT-31920 and https://javafx-jira.kenai.com/browse/RT-31249 for more information. As a temporary solution we have implemented this functionality in FX native library Glass so that we can use it in JDK/FX 8. But since this API doesn't belong to a GUI toolkit, we would like to see this API implemented in core JDK instead.

      It would be perfect to add this API in JDK 8 if possible. However, JDK 9 should work good for us as well.


          Issue Links



              • Assignee:
                anthony Anthony Petrov (Inactive)
              • Votes:
                1 Vote for this issue
                4 Start watching this issue


                • Created: