com.groupdocs.annotation.cache

Class FileCache

  • All Implemented Interfaces:
    ICache


    public class FileCache
    extends Object
    implements ICache

    Represents a local on-disk cache.

    • Constructor Detail

      • FileCache

        public FileCache()

        Initializes new instance of FileCache class.

      • FileCache

        public FileCache(String path)

        Initializes new instance of FileCache class.

        Parameters:
        path - Path where cache data will be saved
    • Method Detail

      • getKeys

        public final com.aspose.ms.System.Collections.Generic.IGenericEnumerable<String> getKeys(String filter)

        Returns all file names that contains filter in filename.

        Specified by:
        getKeys in interface ICache
        Parameters:
        filter - The filter to use.
        Returns:
        File names that contains filter in filename.
      • set

        public final void set(String key,
               Object value)

        Serializes data to the local disk.

        Specified by:
        set in interface ICache
        Parameters:
        key - An unique identifier for the cache entry.
        value - The object to serialize.
      • tryGetValue

        public final boolean tryGetValue(String key,
                          Object value)

        Deserializes data associated with this key if present.

        Specified by:
        tryGetValue in interface ICache
        Parameters:
        key - A key identifying the requested entry.
        value - The located value or null.
        Returns:
        True if the key was found.