Explorar o código

移除apache/commons-fileupload依赖

RuoYi %!s(int64=3) %!d(string=hai) anos
pai
achega
1ef82d75b1

+ 0 - 8
pom.xml

@@ -29,7 +29,6 @@
29 29
         <druid.version>1.2.16</druid.version>
30 30
         <dynamic-ds.version>3.5.2</dynamic-ds.version>
31 31
         <commons.io.version>2.11.0</commons.io.version>
32
-        <commons.fileupload.version>1.4</commons.fileupload.version>
33 32
         <velocity.version>2.3</velocity.version>
34 33
         <fastjson.version>2.0.23</fastjson.version>
35 34
         <jjwt.version>0.9.1</jjwt.version>
@@ -116,13 +115,6 @@
116 115
                 <version>${poi.version}</version>
117 116
             </dependency>
118 117
 
119
-            <!-- 文件上传工具类 -->
120
-            <dependency>
121
-                <groupId>commons-fileupload</groupId>
122
-                <artifactId>commons-fileupload</artifactId>
123
-                <version>${commons.fileupload.version}</version>
124
-            </dependency>
125
-
126 118
             <!-- 代码生成使用模板 -->
127 119
             <dependency>
128 120
                 <groupId>org.apache.velocity</groupId>

+ 0 - 6
ruoyi-common/ruoyi-common-core/pom.xml

@@ -95,12 +95,6 @@
95 95
             <artifactId>commons-io</artifactId>
96 96
         </dependency>
97 97
 
98
-        <!-- Commons Fileupload -->
99
-        <dependency>
100
-            <groupId>commons-fileupload</groupId>
101
-            <artifactId>commons-fileupload</artifactId>
102
-        </dependency>
103
-
104 98
         <!-- excel工具 -->
105 99
         <dependency>
106 100
             <groupId>org.apache.poi</groupId>

+ 61 - 0
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/FileUploadException.java

@@ -0,0 +1,61 @@
1
+package com.ruoyi.common.core.exception.file;
2
+
3
+import java.io.PrintStream;
4
+import java.io.PrintWriter;
5
+
6
+/**
7
+ * 文件上传异常类
8
+ * 
9
+ * @author ruoyi
10
+ */
11
+public class FileUploadException extends Exception
12
+{
13
+
14
+    private static final long serialVersionUID = 1L;
15
+
16
+    private final Throwable cause;
17
+
18
+    public FileUploadException()
19
+    {
20
+        this(null, null);
21
+    }
22
+
23
+    public FileUploadException(final String msg)
24
+    {
25
+        this(msg, null);
26
+    }
27
+
28
+    public FileUploadException(String msg, Throwable cause)
29
+    {
30
+        super(msg);
31
+        this.cause = cause;
32
+    }
33
+
34
+    @Override
35
+    public void printStackTrace(PrintStream stream)
36
+    {
37
+        super.printStackTrace(stream);
38
+        if (cause != null)
39
+        {
40
+            stream.println("Caused by:");
41
+            cause.printStackTrace(stream);
42
+        }
43
+    }
44
+
45
+    @Override
46
+    public void printStackTrace(PrintWriter writer)
47
+    {
48
+        super.printStackTrace(writer);
49
+        if (cause != null)
50
+        {
51
+            writer.println("Caused by:");
52
+            cause.printStackTrace(writer);
53
+        }
54
+    }
55
+
56
+    @Override
57
+    public Throwable getCause()
58
+    {
59
+        return cause;
60
+    }
61
+}

+ 0 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/file/InvalidExtensionException.java

@@ -1,7 +1,6 @@
1 1
 package com.ruoyi.common.core.exception.file;
2 2
 
3 3
 import java.util.Arrays;
4
-import org.apache.commons.fileupload.FileUploadException;
5 4
 
6 5
 /**
7 6
  * 文件上传 误异常类