类 OTAFileCache

java.lang.Object
com.ghostchu.crowdin.OTAFileCache

public class OTAFileCache extends Object
  • 构造器概要

    构造器
    构造器
    说明
    OTAFileCache(@NotNull File rootCacheFolder)
    Create a OTAFileCache instance to manage the files on the filesystem and caches.
  • 方法概要

    修饰符和类型
    方法
    说明
    @NotNull com.ghostchu.crowdin.OTAFileCache.CacheStatus
    getCacheStatus(@NotNull String crowdinSyntaxCode, long timestamp)
    Gets the specific cache status
    @Nullable String
    readCache(@NotNull String crowdinSyntaxCode, long timestamp, boolean allowExpired)
    Read the cache from the disk.
    void
    writeCache(@NotNull String crowdinSyntaxCode, @NotNull String fileContent, long timestamp)
    Write the cache into disk and update memory DB.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • OTAFileCache

      public OTAFileCache(@NotNull @NotNull File rootCacheFolder) throws OTAException
      Create a OTAFileCache instance to manage the files on the filesystem and caches.
      参数:
      rootCacheFolder - The root folder to store the cache files.
      抛出:
      OTAException - Throws a OTAException while failed to create the cache folder.
  • 方法详细资料

    • readCache

      @Nullable public @Nullable String readCache(@NotNull @NotNull String crowdinSyntaxCode, long timestamp, boolean allowExpired)
      Read the cache from the disk.
      参数:
      crowdinSyntaxCode - The crowdin syntax code.
      timestamp - The timestamp of the manifest.
      allowExpired - Whether to allow expired cache. False will return null for outdated cache.
      返回:
      The cache content
    • writeCache

      public void writeCache(@NotNull @NotNull String crowdinSyntaxCode, @NotNull @NotNull String fileContent, long timestamp)
      Write the cache into disk and update memory DB.
      参数:
      crowdinSyntaxCode - The crowdin syntax code.
      fileContent - The file content.
      timestamp - The timestamp of the manifest.
    • getCacheStatus

      @NotNull public @NotNull com.ghostchu.crowdin.OTAFileCache.CacheStatus getCacheStatus(@NotNull @NotNull String crowdinSyntaxCode, long timestamp)
      Gets the specific cache status
      参数:
      crowdinSyntaxCode - The Crowdin syntax language code
      timestamp - The timestamp of the manifest.
      返回:
      The cache status