MCPcopy Create free account
hub / github.com/XUANXUQAQ/File-Engine / updatePlugins

Method updatePlugins

src/main/java/file/engine/MainClass.java:106–127  ·  view source on GitHub ↗

如果有更新标志,更新插件 @throws FileNotFoundException 找不到文件更新失败

()

Source from the content-addressed store, hash-verified

104 * @throws FileNotFoundException 找不到文件更新失败
105 */
106 private static void updatePlugins() throws FileNotFoundException {
107 File sign = new File("user/updatePlugin");
108 if (!sign.exists()) {
109 return;
110 }
111 if (!sign.delete()) {
112 System.err.println("删除插件更新标志失败");
113 }
114 File tmpPlugins = new File("tmp/pluginsUpdate");
115 if (IsDebug.isDebug()) {
116 log.info("正在更新插件");
117 }
118 File[] files = tmpPlugins.listFiles();
119 if (files == null) {
120 return;
121 }
122 for (File eachPlugin : files) {
123 String pluginName = eachPlugin.getName();
124 File targetPlugin = new File("plugins" + File.separator + pluginName);
125 FileUtil.copyFile(new FileInputStream(eachPlugin), targetPlugin);
126 }
127 }
128
129
130 /**

Callers 1

mainMethod · 0.95

Calls 2

isDebugMethod · 0.95
copyFileMethod · 0.95

Tested by

no test coverage detected