作者 RuoYi

移除apache/commons-fileupload依赖

@@ -26,7 +26,6 @@ @@ -26,7 +26,6 @@
26 <fastjson.version>2.0.23</fastjson.version> 26 <fastjson.version>2.0.23</fastjson.version>
27 <oshi.version>6.4.0</oshi.version> 27 <oshi.version>6.4.0</oshi.version>
28 <commons.io.version>2.11.0</commons.io.version> 28 <commons.io.version>2.11.0</commons.io.version>
29 - <commons.fileupload.version>1.4</commons.fileupload.version>  
30 <commons.collections.version>3.2.2</commons.collections.version> 29 <commons.collections.version>3.2.2</commons.collections.version>
31 <poi.version>4.1.2</poi.version> 30 <poi.version>4.1.2</poi.version>
32 <velocity.version>2.3</velocity.version> 31 <velocity.version>2.3</velocity.version>
@@ -94,13 +93,6 @@ @@ -94,13 +93,6 @@
94 <version>${commons.io.version}</version> 93 <version>${commons.io.version}</version>
95 </dependency> 94 </dependency>
96 95
97 - <!-- 文件上传工具类 -->  
98 - <dependency>  
99 - <groupId>commons-fileupload</groupId>  
100 - <artifactId>commons-fileupload</artifactId>  
101 - <version>${commons.fileupload.version}</version>  
102 - </dependency>  
103 -  
104 <!-- excel工具 --> 96 <!-- excel工具 -->
105 <dependency> 97 <dependency>
106 <groupId>org.apache.poi</groupId> 98 <groupId>org.apache.poi</groupId>
@@ -78,12 +78,6 @@ @@ -78,12 +78,6 @@
78 <artifactId>commons-io</artifactId> 78 <artifactId>commons-io</artifactId>
79 </dependency> 79 </dependency>
80 80
81 - <!-- 文件上传工具类 -->  
82 - <dependency>  
83 - <groupId>commons-fileupload</groupId>  
84 - <artifactId>commons-fileupload</artifactId>  
85 - </dependency>  
86 -  
87 <!-- excel工具 --> 81 <!-- excel工具 -->
88 <dependency> 82 <dependency>
89 <groupId>org.apache.poi</groupId> 83 <groupId>org.apache.poi</groupId>
  1 +package com.ruoyi.common.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 +}
1 package com.ruoyi.common.exception.file; 1 package com.ruoyi.common.exception.file;
2 2
3 import java.util.Arrays; 3 import java.util.Arrays;
4 -import org.apache.commons.fileupload.FileUploadException;  
5 4
6 /** 5 /**
7 * 文件上传 误异常类 6 * 文件上传 误异常类