类 CrowdinOTA
java.lang.Object
com.ghostchu.crowdin.CrowdinOTA
-
字段概要
字段 -
构造器概要
构造器构造器说明CrowdinOTA(@NotNull String distributionUrl, @NotNull File cacheFolder) Create CrowdinOTA instance from a crowdin distribution URL.CrowdinOTA(@NotNull String distributionUrl, @NotNull File cacheFolder, @NotNull kong.unirest.UnirestInstance unirest) Create CrowdinOTA instance from a crowdin distribution URL. -
方法概要
修饰符和类型方法说明@NotNull OTAInstanceGets the OTAInstance which you can locate to load or processing any file instance you want.longGets the timestamp of this manifest@NotNull StringmapLanguageCode(@NotNull String crowdinSyntaxCode, @NotNull String customSyntax) Gets the mapped language code for the given locale.@NotNull StringmapLanguageCustom(@NotNull String customCode, @NotNull String customSyntax) Gets the mapped language code for the given locale.
-
字段详细资料
-
distributionUrl
-
unirest
protected final kong.unirest.UnirestInstance unirest -
cacheFolder
-
manifest
protected com.google.gson.JsonObject manifest -
languageMapping
The language mapping CrowdinSyntaxName, Map(Syntax, CustomName)
-
-
构造器详细资料
-
CrowdinOTA
public CrowdinOTA(@NotNull @NotNull String distributionUrl, @NotNull @NotNull File cacheFolder) throws OTAException Create CrowdinOTA instance from a crowdin distribution URL.- 参数:
distributionUrl- The distribution URL. Example: ...cacheFolder- The folder to put cache files- 抛出:
OTAException- Throws a OTAException while failed during requesting or processing the manifest.
-
CrowdinOTA
public CrowdinOTA(@NotNull @NotNull String distributionUrl, @NotNull @NotNull File cacheFolder, @NotNull @NotNull kong.unirest.UnirestInstance unirest) throws OTAException Create CrowdinOTA instance from a crowdin distribution URL.- 参数:
distributionUrl- The distribution URL. Example: ...cacheFolder- The folder to put cache filesunirest- The unirest instance for requesting- 抛出:
OTAException- Throws a OTAException while failed during requesting or processing manifest.
-
-
方法详细资料
-
getOtaInstance
Gets the OTAInstance which you can locate to load or processing any file instance you want.- 返回:
- The OTAInstance instance.
-
getTimestamp
public long getTimestamp()Gets the timestamp of this manifest- 返回:
- The timestamp of this manifest.
-
mapLanguageCode
@NotNull public @NotNull String mapLanguageCode(@NotNull @NotNull String crowdinSyntaxCode, @NotNull @NotNull String customSyntax) Gets the mapped language code for the given locale. For example: "tr": { "locale": "tr-TR" } In this case, give "tr" for crowdinSyntaxCode and "locale" for customSyntaxName, "tr-TR" will be returns. If nothing matches, return crowdinSyntaxCode as-is.- 参数:
crowdinSyntaxCode- The language code (crowdin name)customSyntax- The mapping name (custom name)- 返回:
- The mapped language code
-
mapLanguageCustom
@NotNull public @NotNull String mapLanguageCustom(@NotNull @NotNull String customCode, @NotNull @NotNull String customSyntax) Gets the mapped language code for the given locale. For example: "tr": { "locale": "tr-TR" } In this case, give "tr-TR" for customCode and "locale" for customSyntaxName, "tr" will be returns. If nothing matches, return customCode as-is. It is the mapLanguage's reserve- 参数:
customCode- The language code (custom name)customSyntax- The custom syntax name- 返回:
- The mapped language code
-