java实现上传zip/rar压缩文件,自动解压

时间:2024-10-09 20:25:33
  • <?xml version="1.0" encoding="UTF-8"?>
  • <project xmlns="/POM/4.0.0" xmlns:xsi="http:///2001/XMLSchema-instance"
  • xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.">
  • <modelVersion>4.0.0</modelVersion>
  • <parent>
  • <groupId></groupId>
  • <artifactId>spring-boot-starter-parent</artifactId>
  • <version>2.1.2.RELEASE</version>
  • <relativePath/> <!-- lookup parent from repository -->
  • </parent>
  • <groupId></groupId>
  • <artifactId>uncompress</artifactId>
  • <version>0.0.1-SNAPSHOT</version>
  • <name>uncompress</name>
  • <description>上传压缩文件(rar或者zip格式),解压</description>
  • <properties>
  • <>1.8</>
  • </properties>
  • <dependencies>
  • <dependency>
  • <groupId></groupId>
  • <artifactId>spring-boot-starter-web</artifactId>
  • </dependency>
  • <dependency>
  • <groupId></groupId>
  • <artifactId>lombok</artifactId>
  • <optional>true</optional>
  • </dependency>
  • <dependency>
  • <groupId></groupId>
  • <artifactId>spring-boot-starter-test</artifactId>
  • <scope>test</scope>
  • </dependency>
  • <dependency>
  • <groupId></groupId>
  • <artifactId>spring-boot-starter-thymeleaf</artifactId>
  • </dependency>
  • <!--
  • 从Zip文件创建,添加,提取,更新,删除文件
  • /写密码保护的Zip文件
  • 支持AES 128/256加密
  • 支持标准邮​​编加密
  • 支持Zip64格式
  • 支持存储(无压缩)和Deflate压缩方法
  • 从Split Zip文件创建或提取文件(例如:z01,z02,... zip)
  • 支持Unicode文件名
  • 进度监视器
  • -->
  • <!--zip4j依赖,解压zip压缩-->
  • <dependency>
  • <groupId>4j</groupId>
  • <artifactId>zip4j</artifactId>
  • <version>1.3.2</version>
  • </dependency>
  • <!--解压rar压缩-->
  • <dependency>
  • <groupId></groupId>
  • <artifactId>junrar</artifactId>
  • <version>0.7</version>
  • </dependency>
  • </dependencies>
  • <build>
  • <plugins>
  • <plugin>
  • <groupId></groupId>
  • <artifactId>spring-boot-maven-plugin</artifactId>
  • </plugin>
  • </plugins>
  • </build>
  • </project>