Class CacheDir

java.lang.Object
io.deephaven.configuration.CacheDir

public final class CacheDir extends Object
The cache directory is a directory that the application may use for storing data with "cache-like" semantics. Cache-like data is data that may be preserved across restarts, but the application logic should not make the assumptions that the data will be available.
  • Field Details

  • Constructor Details

    • CacheDir

      public CacheDir()
  • Method Details

    • get

      public static Path get()
      Return the system property value for "deephaven.cacheDir" if it is present.

      Otherwise, return the environment value for "DEEPHAVEN_CACHE_DIR" if it is present.

      Otherwise, return "%s/deephaven/cache", parameterized from the value of the system property "java.io.tmpdir".

      Returns:
      the cache dir
    • getOrSet

      public static Path getOrSet(String defaultValue)
      Gets the cache directory if the system property "deephaven.cacheDir" or environment variable "DEEPHAVEN_CACHE_DIR" is present, otherwise sets the system property "deephaven.cacheDir" to defaultValue and returns defaultValue.
      Parameters:
      defaultValue - the value to set if none is present
      Returns:
      the cache directory