From 12ef11c20e96438187c8019f1c59053439ee105d Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Tue, 11 Oct 2022 09:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=88=97=E8=A1=A8=E5=90=8C=E6=97=B6=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/file/FileUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 3a0cc8b..6547e4d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -3,6 +3,7 @@ package com.ruoyi.common.utils.file; import java.io.*; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Base64; import java.util.List; @@ -380,12 +381,13 @@ public class FileUtils if (!directory.isDirectory()) { throw new ServiceException(folderPath + "is not directory."); } + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (directory.isDirectory()) { File[] fileList = directory.listFiles(); assert fileList != null; for (File file : fileList) { if (!file.isDirectory()) { - scanFiles.add(file.getAbsolutePath()); + scanFiles.add(file.getAbsolutePath() + "&" + dateFormat.format(file.lastModified())); } } }