From 38f8e6c7946111b38b0ef41ac7b73f55b0e23d7b Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Sat, 28 Apr 2018 16:26:52 +0800 Subject: [PATCH] =?UTF-8?q?Window=E6=9C=BA=E5=99=A8=E4=B8=8BFile.separator?= =?UTF-8?q?=E4=B8=8D=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 1 + .../java/com/xxl/job/core/handler/impl/ScriptJobHandler.java | 4 +++- .../main/java/com/xxl/job/core/log/XxlJobFileAppender.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 8ea5c823..bfd65e61 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1168,6 +1168,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 5、任务日志表状态字段类型优化; - 6、[迭代中]脚本任务支持失败重试; - 7、告警邮箱支持SSL配置; +- 8、Window机器下File.separator不兼容问题修复; ### TODO LIST diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java b/xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java index ffa453c6..9adf1242 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/handler/impl/ScriptJobHandler.java @@ -8,6 +8,8 @@ import com.xxl.job.core.log.XxlJobLogger; import com.xxl.job.core.util.ScriptUtil; import com.xxl.job.core.util.ShardingUtil; +import java.io.File; + /** * Created by xuxueli on 17/4/27. */ @@ -41,7 +43,7 @@ public class ScriptJobHandler extends IJobHandler { // make script file String scriptFileName = XxlJobFileAppender.getGlueSrcPath() - .concat("/") + .concat(File.separator) .concat(String.valueOf(jobId)) .concat("_") .concat(String.valueOf(glueUpdatetime)) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java b/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java index b2c628a1..0c880968 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/log/XxlJobFileAppender.java @@ -79,7 +79,7 @@ public class XxlJobFileAppender { // filePath/yyyy-MM-dd/9999.log String logFileName = logFilePath.getPath() - .concat("/") + .concat(File.separator) .concat(String.valueOf(logId)) .concat(".log"); return logFileName;