使用新的GsonAgent代理类...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2016-01-05 17:04:56 +08:00
parent 8910bb664d
commit d1fd6daa9a
2 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; 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.PluginHelper.utils.IOUtil;
import cn.citycraft.Yum.manager.RepoSerialization.Repositories; import cn.citycraft.Yum.manager.RepoSerialization.Repositories;
@ -15,7 +15,7 @@ public class RepoCache {
Map<String, Repositories> repos = new HashMap<String, Repositories>(); Map<String, Repositories> repos = new HashMap<String, Repositories>();
public static RepoCache fromJson(final String json) { 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) { public void addPlugins(final String name, final PluginInfo info) {
@ -51,7 +51,7 @@ public class RepoCache {
if (json == null || json.isEmpty()) { if (json == null || json.isEmpty()) {
return null; return null;
} }
final Repositories reposes = JsonHandler.fromJson(json, Repositories.class); final Repositories reposes = JsonHandle.fromJson(json, Repositories.class);
if (reposes == null || reposes.repos.isEmpty()) { if (reposes == null || reposes.repos.isEmpty()) {
return null; return null;
} }
@ -72,6 +72,6 @@ public class RepoCache {
@Override @Override
public String toString() { public String toString() {
return JsonHandler.toJson(this); return JsonHandle.toJson(this);
} }
} }

View File

@ -14,7 +14,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import cn.citycraft.PluginHelper.config.FileConfig; 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.IOUtil;
import cn.citycraft.PluginHelper.utils.StringUtil; import cn.citycraft.PluginHelper.utils.StringUtil;
import cn.citycraft.Yum.manager.RepoSerialization.PackageInfo; import cn.citycraft.Yum.manager.RepoSerialization.PackageInfo;
@ -171,14 +171,14 @@ public class RepositoryManager {
public PackageInfo jsonToPackage(final String json) { public PackageInfo jsonToPackage(final String json) {
try { try {
return JsonHandler.fromJson(json, PackageInfo.class); return JsonHandle.fromJson(json, PackageInfo.class);
} catch (final Exception e) { } catch (final Exception e) {
return null; return null;
} }
} }
public Repositories jsonToRepositories(final String json) { 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) { public void updatePackage(final CommandSender sender, final PackageInfo pkg) {