Skip to content

Commit 850d4c3

Browse files
authored
bugfix: create File error on linux (#235)
1 parent 9703b37 commit 850d4c3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

center/src/main/java/com/microsoft/hydralab/center/service/AgentManageService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package com.microsoft.hydralab.center.service;
44

55
import com.microsoft.hydralab.center.repository.AgentUserRepository;
6+
import com.microsoft.hydralab.center.util.CenterConstant;
67
import com.microsoft.hydralab.center.util.SecretGenerator;
78
import com.microsoft.hydralab.common.entity.center.AgentUser;
89
import com.microsoft.hydralab.common.entity.center.SysUser;
@@ -138,7 +139,7 @@ public File generateAgentConfigFile(String agentId) {
138139
File agentConfigFile = File.createTempFile(
139140
"application",
140141
".yml",
141-
new File(".\\"));
142+
new File(CenterConstant.CENTER_TEMP_FILE_DIR));
142143

143144
FileWriter fileWriter = new FileWriter(agentConfigFile.getAbsolutePath());
144145
fileWriter.write("app:\n" +

center/src/main/java/com/microsoft/hydralab/center/util/CenterConstant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44

55
public class CenterConstant {
66
public static final String CENTER_FILE_BASE_DIR = "storage/test/package/";
7+
public static final String CENTER_TEMP_FILE_DIR = "storage/temp/";
78
}

0 commit comments

Comments
 (0)