Browse Source

移除apache/commons-fileupload依赖

pull/439/MERGE
RuoYi 2 years ago
parent
commit
0bbe126125
  1. 8
      pom.xml
  2. 6
      ruoyi-common/pom.xml
  3. 59
      ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java
  4. 1
      ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java

8
pom.xml

@ -27,7 +27,6 @@
<fastjson.version>1.2.83</fastjson.version>
<oshi.version>6.4.0</oshi.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
</properties>
@ -128,13 +127,6 @@
<version>${commons.io.version}</version>
</dependency>
<!-- 文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>

6
ruoyi-common/pom.xml

@ -77,12 +77,6 @@
<artifactId>commons-io</artifactId>
</dependency>
<!-- 文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>

59
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;
}
}

1
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;
/**
* 文件上传 误异常类

Loading…
Cancel
Save