Package net.sf.ehcache
Class DiskStorePathManager
- java.lang.Object
-
- net.sf.ehcache.DiskStorePathManager
-
public final class DiskStorePathManager extends java.lang.ObjectManager class to handle disk store path. CacheManager has a reference to this manager.- Author:
- hhuynh
-
-
Constructor Summary
Constructors Constructor Description DiskStorePathManager()Create a diskstore path manager using the default path.DiskStorePathManager(java.lang.String initialPath)Create a diskstore path manager with provided initial path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.FilegetFile(java.lang.String name)Get a file object for the given namejava.io.FilegetFile(java.lang.String cacheName, java.lang.String suffix)Get a file object for the given cache-name and suffixbooleanisAutoCreated()Was this path auto-created (ie.booleanisDefault()Was this path sourced from the default value.voidreleaseLock()release the lock file used for collision detection should be called when cache manager shutdownsbooleanresolveAndLockIfExists(java.lang.String file)Resolve and lock this disk store path if the resultant path contains the supplied file.
-
-
-
Constructor Detail
-
DiskStorePathManager
public DiskStorePathManager(java.lang.String initialPath)
Create a diskstore path manager with provided initial path.- Parameters:
initialPath- diskstore path on disk
-
DiskStorePathManager
public DiskStorePathManager()
Create a diskstore path manager using the default path.
-
-
Method Detail
-
resolveAndLockIfExists
public boolean resolveAndLockIfExists(java.lang.String file)
Resolve and lock this disk store path if the resultant path contains the supplied file.- Parameters:
file- file to check for- Returns:
trueif the file existed and the path was successfully locked
-
isAutoCreated
public boolean isAutoCreated()
Was this path auto-created (ie. the result of a collision)- Returns:
- true if path is auto created
-
isDefault
public boolean isDefault()
Was this path sourced from the default value.- Returns:
- true if path is the default
-
releaseLock
public void releaseLock()
release the lock file used for collision detection should be called when cache manager shutdowns
-
getFile
public java.io.File getFile(java.lang.String cacheName, java.lang.String suffix)Get a file object for the given cache-name and suffix- Parameters:
cacheName- the cache namesuffix- a file suffix- Returns:
- a file object
-
getFile
public java.io.File getFile(java.lang.String name)
Get a file object for the given name- Parameters:
name- the file name- Returns:
- a file object
-
-