From d14a82b015ae737cfc1c8ceb959f03d79f71e4fd Mon Sep 17 00:00:00 2001 From: sws <15810472099@163.com> Date: 星期三, 23 十一月 2022 13:45:37 +0800 Subject: [PATCH] 22 --- src/main/java/com/lf/server/service/all/BaseUploadService.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/lf/server/service/all/BaseUploadService.java b/src/main/java/com/lf/server/service/all/BaseUploadService.java index 85903e5..6edd901 100644 --- a/src/main/java/com/lf/server/service/all/BaseUploadService.java +++ b/src/main/java/com/lf/server/service/all/BaseUploadService.java @@ -33,7 +33,7 @@ /** * 鏌ヨ鏂囦欢 */ - public List<MetaFileEntity> selectFiles(String subPath) throws IOException { + public List<MetaFileEntity> selectFiles(String subPath, List<String> extList) throws IOException { String root = pathHelper.getConfig().getTempPath() + File.separator + subPath; File file = new File(root); @@ -48,6 +48,13 @@ List<MetaFileEntity> list = new ArrayList<MetaFileEntity>(); for (File f : files) { String fileName = FileHelper.getFileName(f.getPath()); + if (null != extList) { + String extName = FileHelper.getExtension(fileName); + if (!extList.contains(extName)) { + continue; + } + } + double sizes = FileHelper.sizeToMb(f.length()); String filePath = subPath + File.separator + fileName; -- Gitblit v1.9.3