项目作者: dercilima

项目描述 :
A library used to zip, unzip and test zip files
高级语言: Java
项目地址: git://github.com/dercilima/ZipFiles.git
创建时间: 2018-08-15T12:24:25Z
项目社区:https://github.com/dercilima/ZipFiles

开源协议:

下载


ZipFiles

Visão geral

Biblioteca utilizada para compactar e descompactar arquivos independentes ou um conjunto de arquivos.

Setup

Gradle

implementation 'com.github.dercilima:zipfiles:0.0.1'

Maven

  1. <dependency>
  2. <groupId>com.github.dercilima</groupId>
  3. <artifactId>zipfiles</artifactId>
  4. <version>0.0.1</version>
  5. </dependency>

Como usar

Compactar

  1. try {
  2. // Arquivo para zipar
  3. final File fileToZip = new File("your_path", "your_file.txt");
  4. // Diretório de saída
  5. final File outputDirectory = new File("your_source_path", "YourFileZip.zip");
  6. // Zip
  7. new ZipFiles(Collections.singletonList(fileToZip), outputDirectory).zip();
  8. } catch (IOException e) {
  9. e.printStackTrace();
  10. }

Descompactar

  1. try {
  2. // Arquivo zipado
  3. final File zipFile = new File("your_path", "YourFileZip.zip");
  4. // Diretório de saída
  5. final File outputDir = new File("your_source_path", "extracted_directory");
  6. // Unzip
  7. new ZipFiles(zipFile, outputDir).unzip();
  8. } catch (IOException e) {
  9. e.printStackTrace();
  10. }

Developed By

License

  1. Copyright 2018 Derci Santos
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.