Skip to content

Commit

Permalink
add: 删除jar从磁盘删除文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Wizzercn committed Jan 7, 2021
1 parent a77c091 commit 266f8b9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import org.nutz.dao.Cnd;
import org.nutz.dao.pager.Pager;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Files;
import org.nutz.lang.Streams;
import org.nutz.lang.Strings;
import org.nutz.lang.stream.StringInputStream;
Expand All @@ -36,6 +38,7 @@

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -59,6 +62,8 @@ public class SysAppController {
private SysAppTaskService sysAppTaskService;
@Inject
private RedisService redisService;
@Inject
private PropertiesProxy conf;

@At("")
@Ok("beetl:/platform/sys/app/index.html")
Expand Down Expand Up @@ -188,6 +193,9 @@ public Object jarSearch(@Param("appName") String appName) {
@SLog(tag = "删除Jar包", msg = "ID:${id}")
public Object jarDelete(String id, HttpServletRequest req) {
try {
Sys_app_list appList = sysAppListService.fetch(id);
String staticPath = conf.get("jetty.staticPath", "/files");
Files.deleteFile(new File(staticPath + appList.getFilePath()));
sysAppListService.delete(id);
return Result.success();
} catch (Exception e) {
Expand Down

0 comments on commit 266f8b9

Please sign in to comment.