|
|
|
|
@ -3,6 +3,7 @@ package com.leaper.pm2java.util;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.leaper.pm2java.entity.AppServerEntity;
|
|
|
|
|
import com.leaper.pm2java.service.impl.Pm2JavaServiceImpl;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
@ -18,6 +19,7 @@ public class FileUtil {
|
|
|
|
|
static String confPath = "/appConf/";
|
|
|
|
|
static String appSuffix = ".appConf";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//持久化记录为文件
|
|
|
|
|
static public boolean saveFile(AppServerEntity appConfigEntity) {
|
|
|
|
|
appConfigEntity.setType(2);
|
|
|
|
|
@ -61,9 +63,14 @@ public class FileUtil {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//持久化记录为文件
|
|
|
|
|
static public List<AppServerEntity> readFile() {
|
|
|
|
|
static public List<AppServerEntity> readFile( String appDir) {
|
|
|
|
|
|
|
|
|
|
String currentFolder = System.getProperty("user.dir");
|
|
|
|
|
String currentFolder;
|
|
|
|
|
if( appDir != null && appDir.length() > 0){
|
|
|
|
|
currentFolder = appDir;
|
|
|
|
|
}else {
|
|
|
|
|
currentFolder = System.getProperty("user.dir");
|
|
|
|
|
}
|
|
|
|
|
File folder = new File(currentFolder + confPath);
|
|
|
|
|
File[] files = folder.listFiles();
|
|
|
|
|
List<AppServerEntity> list = new ArrayList<>();
|
|
|
|
|
|