Package io.deephaven.configuration
Class CacheDir
java.lang.Object
io.deephaven.configuration.CacheDir
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Path
get()
Return the system property value for "deephaven.cacheDir" if it is present.static Path
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" todefaultValue
and returnsdefaultValue
.
-
Field Details
-
PROPERTY
- See Also:
-
ENV_VAR
- See Also:
-
-
Constructor Details
-
CacheDir
public CacheDir()
-
-
Method Details
-
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
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" todefaultValue
and returnsdefaultValue
.- Parameters:
defaultValue
- the value to set if none is present- Returns:
- the cache directory
-