mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-12-23 05:08:47 +00:00
使用新的GsonAgent代理类...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
8910bb664d
commit
d1fd6daa9a
@ -6,7 +6,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import cn.citycraft.PluginHelper.jsonresult.JsonHandler;
|
||||
import cn.citycraft.PluginHelper.jsonresult.JsonHandle;
|
||||
import cn.citycraft.PluginHelper.utils.IOUtil;
|
||||
import cn.citycraft.Yum.manager.RepoSerialization.Repositories;
|
||||
|
||||
@ -15,7 +15,7 @@ public class RepoCache {
|
||||
Map<String, Repositories> repos = new HashMap<String, Repositories>();
|
||||
|
||||
public static RepoCache fromJson(final String json) {
|
||||
return JsonHandler.fromJson(json, RepoCache.class);
|
||||
return JsonHandle.fromJson(json, RepoCache.class);
|
||||
}
|
||||
|
||||
public void addPlugins(final String name, final PluginInfo info) {
|
||||
@ -51,7 +51,7 @@ public class RepoCache {
|
||||
if (json == null || json.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
final Repositories reposes = JsonHandler.fromJson(json, Repositories.class);
|
||||
final Repositories reposes = JsonHandle.fromJson(json, Repositories.class);
|
||||
if (reposes == null || reposes.repos.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@ -72,6 +72,6 @@ public class RepoCache {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonHandler.toJson(this);
|
||||
return JsonHandle.toJson(this);
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import cn.citycraft.PluginHelper.config.FileConfig;
|
||||
import cn.citycraft.PluginHelper.jsonresult.JsonHandler;
|
||||
import cn.citycraft.PluginHelper.jsonresult.JsonHandle;
|
||||
import cn.citycraft.PluginHelper.utils.IOUtil;
|
||||
import cn.citycraft.PluginHelper.utils.StringUtil;
|
||||
import cn.citycraft.Yum.manager.RepoSerialization.PackageInfo;
|
||||
@ -171,14 +171,14 @@ public class RepositoryManager {
|
||||
|
||||
public PackageInfo jsonToPackage(final String json) {
|
||||
try {
|
||||
return JsonHandler.fromJson(json, PackageInfo.class);
|
||||
return JsonHandle.fromJson(json, PackageInfo.class);
|
||||
} catch (final Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Repositories jsonToRepositories(final String json) {
|
||||
return JsonHandler.fromJson(json, Repositories.class);
|
||||
return JsonHandle.fromJson(json, Repositories.class);
|
||||
}
|
||||
|
||||
public void updatePackage(final CommandSender sender, final PackageInfo pkg) {
|
||||
|
Loading…
Reference in New Issue
Block a user