Giter Club home page Giter Club logo

andzip's Introduction

zip

内部包含ZIP,GZIP压缩实现(没有解压操作)。

‘’‘

new ZIPFileUtils.Builder()
                        .setStragy(ZipStragy.ZIP)
                        .addEndFilter(".gz")
                        .addEndFilter(".zip")
                        .setListener(new ZipFileListener() {
                            @Override
                            public void getZipFilePath(String zipFilePath) {
                                Log.d("测试压缩", zipFilePath);
                            }

                            @Override
                            public void failureZip() {
                                Log.d("测试压缩", "失败");
                            }
                        })
                        .setOrginFilePath("/storage/emulated/0/flog/com.longshihan.flog")
                        .setDeleteOriginFile(true)
                        .build();

’‘’�

采用Builder建筑者模式,内部的实现也是遵循此规范,方便书写。可以不实现ZIPFileUtils,只实现内部的也可,代码如下:�

‘’‘

 ZipUtils.getInstance().setSourceFilePath(getOrginFilePath())//原始路径
                              .setZipFilePath(getZipFilePath())//目标路径
                              .setDeleteOriginFile(isDeleteOriginFile())//是否删除压缩过的文件
                              .setEndFilters(endLists)//遵循尾过滤
                              .setContainerFilters(containerLists);//遵循存在过滤
                      String path = ZipUtils.getInstance().save2ZIPFile();

’‘’

其中默认情况下(不输入目标路径)GZIP压缩后的格式是�.gz,ZIP压缩后的格式是.zip。其中没有实现动态权限部分。

andzip's People

Contributors

longshihan1 avatar

Watchers

 avatar  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.