Class FileCache<T extends FileCache.Cacheable>


  • public class FileCache<T extends FileCache.Cacheable>
    extends java.lang.Object
    FileCache stores items associated with a file and expires them if the file is removed or modified. The FileCache.ItemCreator interface is used to create cacheable items
    • Method Detail

      • remove

        public void remove​(java.io.File file)
        Remove entry for a file.
        Parameters:
        file - file
      • cachedFiles

        public java.util.Set<java.io.File> cachedFiles()
      • memoFile

        public static java.lang.String memoFile​(java.io.File file)
      • get

        public T get​(java.io.File file,
                     FileCache.ItemCreator<T> creator)
        Get entry for a file, and use the creator if necessary to create it. The creator will be called if the cache is out of date for the file. If the created item is equals to any existing cached item for the file then the old item will not be replaced. Otherwise, if the old item is FileCache.Expireable then the FileCache.Expireable.expire() method will be called on it.
        Parameters:
        file - the ifle
        creator - the item creator
        Returns:
        the item associated with the file, or null if none is found