Class AppDataDirectory

java.lang.Object
org.bitcoinj.utils.AppDataDirectory

public class AppDataDirectory extends 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.
  • Constructor Details

    • AppDataDirectory

      public AppDataDirectory()
  • Method Details

    • get

      public static Path get(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 Path getPath(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