ehcache

net.sf.ehcache
Class DiskStorePathManager

java.lang.Object
  extended by net.sf.ehcache.DiskStorePathManager

public final class DiskStorePathManager
extends Object

Manager class to handle disk store path. CacheManager has a reference to this manager.

Author:
hhuynh

Constructor Summary
DiskStorePathManager()
          Create a diskstore path manager using the default path.
DiskStorePathManager(String initialPath)
          Create a diskstore path manager with provided initial path.
 
Method Summary
 File getFile(String name)
          Get a file object for the given name
 File getFile(String cacheName, String suffix)
          Get a file object for the given cache-name and suffix
 boolean isAutoCreated()
          Was this path auto-created (ie.
 boolean isDefault()
          Was this path sourced from the default value.
 void releaseLock()
          release the lock file used for collision detection should be called when cache manager shutdowns
 boolean resolveAndLockIfExists(String file)
          Resolve and lock this disk store path if the resultant path contains the supplied file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskStorePathManager

public DiskStorePathManager(String initialPath)
Create a diskstore path manager with provided initial path.

Parameters:
path -

DiskStorePathManager

public DiskStorePathManager()
Create a diskstore path manager using the default path.

Method Detail

resolveAndLockIfExists

public boolean resolveAndLockIfExists(String file)
Resolve and lock this disk store path if the resultant path contains the supplied file.

Parameters:
file - file to check for
Returns:
true if 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 File getFile(String cacheName,
                    String suffix)
Get a file object for the given cache-name and suffix

Parameters:
cacheName - the cache name
suffix - a file suffix
Returns:
a file object

getFile

public File getFile(String name)
Get a file object for the given name

Parameters:
name - the file name
Returns:
a file object

ehcache

Copyright 2001-2014, Terracotta, Inc.