Browse Source

Window机器下File.separator不兼容问题修复;

xuxueli 7 years ago
parent
commit
38f8e6c794

+ 1 - 0
doc/XXL-JOB官方文档.md View File

@@ -1168,6 +1168,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
1168 1168
 - 5、任务日志表状态字段类型优化;
1169 1169
 - 6、[迭代中]脚本任务支持失败重试;
1170 1170
 - 7、告警邮箱支持SSL配置;
1171
+- 8、Window机器下File.separator不兼容问题修复;
1171 1172
 
1172 1173
 
1173 1174
 ### TODO LIST

+ 3 - 1
xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java View File

@@ -8,6 +8,8 @@ import com.xxl.job.core.log.XxlJobLogger;
8 8
 import com.xxl.job.core.util.ScriptUtil;
9 9
 import com.xxl.job.core.util.ShardingUtil;
10 10
 
11
+import java.io.File;
12
+
11 13
 /**
12 14
  * Created by xuxueli on 17/4/27.
13 15
  */
@@ -41,7 +43,7 @@ public class ScriptJobHandler extends IJobHandler {
41 43
 
42 44
         // make script file
43 45
         String scriptFileName = XxlJobFileAppender.getGlueSrcPath()
44
-                .concat("/")
46
+                .concat(File.separator)
45 47
                 .concat(String.valueOf(jobId))
46 48
                 .concat("_")
47 49
                 .concat(String.valueOf(glueUpdatetime))

+ 1 - 1
xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java View File

@@ -79,7 +79,7 @@ public class XxlJobFileAppender {
79 79
 
80 80
 		// filePath/yyyy-MM-dd/9999.log
81 81
 		String logFileName = logFilePath.getPath()
82
-				.concat("/")
82
+				.concat(File.separator)
83 83
 				.concat(String.valueOf(logId))
84 84
 				.concat(".log");
85 85
 		return logFileName;