Class AppDataDirectory


  • public class AppDataDirectory
    extends java.lang.Object
    Find/create App Data Directory in correct platform-specific location. This class is based on the conventions used in Bitcoin Core which uses the following locations:
    Windows
    ${APPDATA}/.bitcoin
    macOS
    ${HOME}/Library/Application Support/Bitcoin
    Linux
    ${HOME}/.bitcoin
    Note that appName is converted to lower-case on Windows and Linux/Unix.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.nio.file.Path get​(java.lang.String appName)
      Get and create if necessary the Path to the application data directory.
      static java.nio.file.Path getPath​(java.lang.String appName)
      Return the Path to the application data directory without making sure it exists or creating it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AppDataDirectory

        public AppDataDirectory()
    • Method Detail

      • get

        public static java.nio.file.Path get​(java.lang.String appName)
        Get and create if necessary the Path to the application data directory.
        Parameters:
        appName - The name of the current application
        Returns:
        Path to the application data directory
      • getPath

        public static java.nio.file.Path getPath​(java.lang.String appName)
        Return the Path to the application data directory without making sure it exists or creating it. (No disk I/O)
        Parameters:
        appName - The name of the current application
        Returns:
        Path to the application data directory