mirror of https://gitee.com/makejava/EasyCode.git
更改获取配置文件保存目录的方式
This commit is contained in:
parent
2683eaab72
commit
8043a9b125
|
@ -22,7 +22,6 @@ import com.sjhy.plugin.entity.TypeMapper;
|
||||||
import com.sjhy.plugin.service.TableInfoService;
|
import com.sjhy.plugin.service.TableInfoService;
|
||||||
import com.sjhy.plugin.tool.*;
|
import com.sjhy.plugin.tool.*;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -51,11 +50,6 @@ public class TableInfoServiceImpl implements TableInfoService {
|
||||||
*/
|
*/
|
||||||
private FileUtils fileUtils;
|
private FileUtils fileUtils;
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存的相对路径
|
|
||||||
*/
|
|
||||||
private static final String SAVE_PATH = "/.idea/EasyCodeConfig";
|
|
||||||
|
|
||||||
public TableInfoServiceImpl(Project project) {
|
public TableInfoServiceImpl(Project project) {
|
||||||
this.project = project;
|
this.project = project;
|
||||||
this.nameUtils = NameUtils.getInstance();
|
this.nameUtils = NameUtils.getInstance();
|
||||||
|
@ -331,16 +325,12 @@ public class TableInfoServiceImpl implements TableInfoService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 获取或创建保存目录
|
// 获取或创建保存目录
|
||||||
String path = project.getBasePath() + SAVE_PATH;
|
VirtualFile dir = getEasyCodeConfigDirectory(project);
|
||||||
File dir = new File(path);
|
if (dir == null) {
|
||||||
if (!dir.exists()) {
|
return;
|
||||||
if (!dir.mkdirs()) {
|
|
||||||
Messages.showWarningDialog("保存失败,无法创建目录。", MsgValue.TITLE_INFO);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 获取保存文件
|
// 获取保存文件
|
||||||
new SaveFile(project, dir.getAbsolutePath(), getConfigFileName(oldTableInfo.getObj()), content, true, false).write();
|
new SaveFile(project, dir.getPath(), getConfigFileName(oldTableInfo.getObj()), content, true, false).write();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue