Interface ResourceManager
-
public interface ResourceManager
插件資源管理器
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classResourceManager.Type插件資源類別
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<File>downloadLatestVersion(String plugin)下載該插件的最新版本voidfetchLatestVersion(String plugin, Consumer<String> afterRun, Consumer<Exception> errorRun)刷新該插件的最新版本到快取StringgetLatestVersion(String plugin)獲取該插件的最新版本booleanisLatestVersion(String plugin)檢查該插件版本是否為最新版本
-
-
-
Method Detail
-
getLatestVersion
String getLatestVersion(String plugin) throws PluginNotFoundException, ResourceNotFoundException
獲取該插件的最新版本- Parameters:
plugin- 插件名稱- Returns:
- 版本名稱
- Throws:
PluginNotFoundException- 找不到插件ResourceNotFoundException- 找不到遠端資源
-
isLatestVersion
boolean isLatestVersion(String plugin) throws PluginNotFoundException, ResourceNotFoundException
檢查該插件版本是否為最新版本- Parameters:
plugin- 插件名稱- Returns:
- 是否為最新版本
- Throws:
PluginNotFoundException- 找不到插件ResourceNotFoundException- 找不到遠端資源
-
fetchLatestVersion
void fetchLatestVersion(String plugin, Consumer<String> afterRun, Consumer<Exception> errorRun)
刷新該插件的最新版本到快取- Parameters:
plugin- 插件名稱afterRun- 運行成功時errorRun- 出現錯誤時
-
downloadLatestVersion
CompletableFuture<File> downloadLatestVersion(String plugin) throws PluginNotFoundException
下載該插件的最新版本- Parameters:
plugin- 插件名稱- Returns:
- 插件檔案, 找不到遠端資源時為 null
- Throws:
PluginNotFoundException- 找不到插件
-
-