public final class DiskStoreConfiguration
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
DiskStoreConfiguration.Env
A constants class for environment variables used in disk store paths
|
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private java.lang.String |
originalPath
The path as specified in the config
|
private java.lang.String |
path
The path to the directory where .data and .index files will be created.
|
private static java.util.regex.Pattern |
PROPERTY_SUBSTITUTION_PATTERN |
Constructor and Description |
---|
DiskStoreConfiguration() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDefaultPath()
The diskStore default path, which is the system environment variable
available on all Java virtual machines
java.io.tmpdir |
java.lang.String |
getOriginalPath() |
java.lang.String |
getPath()
The diskStore path
|
DiskStoreConfiguration |
path(java.lang.String path)
Builder method to set the disk store path, see
setPath(String) |
void |
setPath(java.lang.String path)
Translates and sets the path.
|
private static java.lang.String |
substituteProperties(java.lang.String string) |
private static java.lang.String |
translatePath(java.lang.String path) |
private static final java.util.regex.Pattern PROPERTY_SUBSTITUTION_PATTERN
private static final org.slf4j.Logger LOG
private java.lang.String originalPath
private java.lang.String path
public final java.lang.String getPath()
public static java.lang.String getDefaultPath()
java.io.tmpdir
public final DiskStoreConfiguration path(java.lang.String path)
setPath(String)
public final void setPath(java.lang.String path)
Two forms of path substitution are supported:
java.io.tmpdir/ehcache/java.io.tmpdir
→
/var/tmp/ehcache/java.io.tmpdir
).
user.home
- the user's home directoryuser.dir
- the current working directoryjava.io.tmpdir
- the default temp file pathehcache.disk.store.dir
- a system property you would normally specify on the command line, e.g.
java -Dehcache.disk.store.dir=/u01/myapp/diskdir
${property-name}
. Using
this syntax all token instances are replaced (e.g. ${java.io.tmpdir}/ehcache/${java.io.tmpdir}
→
/var/tmp/ehcache/var/tmp
).path
- disk store pathpublic java.lang.String getOriginalPath()
private static java.lang.String translatePath(java.lang.String path)
private static java.lang.String substituteProperties(java.lang.String string)