diff --git a/pom.xml b/pom.xml index 60d8d5b53..62c7ff9fa 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,6 @@ 1.2.83 6.4.0 2.11.0 - 1.4 4.1.2 2.3 @@ -128,13 +127,6 @@ ${commons.io.version} - - - commons-fileupload - commons-fileupload - ${commons.fileupload.version} - - org.apache.poi diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 3f4adc9e7..8fdaf226f 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -77,12 +77,6 @@ commons-io - - - commons-fileupload - commons-fileupload - - org.apache.poi diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java new file mode 100644 index 000000000..b5108ff60 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java @@ -0,0 +1,59 @@ +package com.ruoyi.common.exception.file; + +import java.io.PrintStream; +import java.io.PrintWriter; + +/** + * 文件上传异常类 + */ +public class FileUploadException extends Exception +{ + + private static final long serialVersionUID = 1L; + + private final Throwable cause; + + public FileUploadException() + { + this(null, null); + } + + public FileUploadException(final String msg) + { + this(msg, null); + } + + public FileUploadException(String msg, Throwable cause) + { + super(msg); + this.cause = cause; + } + + @Override + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + if (cause != null) + { + stream.println("Caused by:"); + cause.printStackTrace(stream); + } + } + + @Override + public void printStackTrace(PrintWriter writer) + { + super.printStackTrace(writer); + if (cause != null) + { + writer.println("Caused by:"); + cause.printStackTrace(writer); + } + } + + @Override + public Throwable getCause() + { + return cause; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java index 7a89e8dc3..f24d744ac 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java @@ -1,7 +1,6 @@ package com.ruoyi.common.exception.file; import java.util.Arrays; -import org.apache.commons.fileupload.FileUploadException; /** * 文件上传 误异常类