Class AppDirs

java.lang.Object
io.github.jbastgen.stemma.app.config.AppDirs

public final class AppDirs extends Object
Where Stemma keeps its own files. Stemma is portable: it never writes to the user's home directory, to %APPDATA%, to ~/Library or to any other system location, only to one configuration directory that travels with the application (copy the folder, copy the settings).

The directory is chosen in this order:

  1. the system property stemma.config.dir or the environment variable STEMMA_CONFIG_DIR (an explicit choice, e.g. for a read-only installation or a USB stick),
  2. <stemma.home>/config, where stemma.home is set by the start scripts of the distribution to the folder they live in,
  3. stemma-config next to the jar the application runs from (the runnable jar),
  4. stemma-config in the current directory (running from class files, e.g. in an IDE).
  • Field Details

  • Method Details

    • configDir

      public static Path configDir()
      The configuration directory of this run (not created yet).
    • logDir

      public static Path logDir()
      The directory for the log files: logs in the application's own directory. Like the configuration it is never a system location. Chosen in this order: stemma.log.dir / STEMMA_LOG_DIR; <config dir>/logs if the configuration directory was chosen explicitly (so both stay together, e.g. on a USB stick); <stemma.home>/logs (the distribution); logs next to the runnable jar; ./logs in the current directory.
    • keepJavaFxCacheLocal

      public static void keepJavaFxCacheLocal()
      Keeps JavaFX from extracting its native libraries to ~/.openjfx: they go to a cache folder inside the configuration directory instead. Call before JavaFX starts. An explicit -Djavafx.cachedir is respected.