类 OTAFileCache
java.lang.Object
com.ghostchu.crowdin.OTAFileCache
-
构造器概要
构造器构造器说明OTAFileCache(@NotNull File rootCacheFolder) Create a OTAFileCache instance to manage the files on the filesystem and caches. -
方法概要
修饰符和类型方法说明@NotNull com.ghostchu.crowdin.OTAFileCache.CacheStatusgetCacheStatus(@NotNull String crowdinSyntaxCode, long timestamp) Gets the specific cache status@Nullable StringRead the cache from the disk.voidwriteCache(@NotNull String crowdinSyntaxCode, @NotNull String fileContent, long timestamp) Write the cache into disk and update memory DB.
-
构造器详细资料
-
OTAFileCache
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 codetimestamp- The timestamp of the manifest.- 返回:
- The cache status
-