Giter VIP home page Giter VIP logo

compress-unpack's Introduction

compress-unpack

compress-unpack介绍

compress-unpack是文件、文件夹压缩解压工具类,可以支持压缩为如下格式:

  • rar
  • zip
  • tar.gz
  • tar

rar格式的压缩与解压

zip格式的压缩与解压

tar.gz格式的压缩与解压

  • 压缩 对tar.gz的压缩分为三步:
    • 压缩为tar文件
    • 将tar文件压缩为gz
    • 删除tar文件
  • 解压
    对tar.gz的解压分为三步:
    • 解压tar.gz为tar文件
    • 解压tar文件
    • 删除tar文件

解压缩工具类的使用

压缩、解压zip:

  • 压缩
String sourcePath = "input/springboot-log";
String targetPath = "compress-output/";
CompressTool.compressToZip(sourcePath, targetPath);
  • 解压
String sourcePath = "input/springboot-log.zip";
String targetPath = "unpack-output/";
File file = new File(sourcePath);
UnpackTool.unpackZip(sourcePath, targetPath);

压缩、解压rar:

  • 解压
String sourcePath = "input/学习.rar";
String targetPath = "unpack-output/";
UnpackTool.unpackRar(sourcePath, targetPath);

压缩、解压tar.gz:

  • 解压
String sourcePath = "input/springboot-log.tar.gz";
String targetPath = "unpack-output/";
UnpackUtil.unpackTarGz(sourcePath, targetPath);
  • 压缩
String sourcePath = "input/springboot-log";
String targetPath = "compress-output/";
CompressUtil.compressToTarGz(sourcePath, targetPath);

compress-unpack's People

Contributors

tiantianupup avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.