Class DiskStorePathManager


  • public final class DiskStorePathManager
    extends java.lang.Object
    Manager 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.File getFile​(java.lang.String name)
      Get a file object for the given name
      java.io.File getFile​(java.lang.String cacheName, java.lang.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​(java.lang.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​(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:
        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 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 name
        suffix - 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