MCPcopy Create free account
hub / github.com/0opslab/opslabJutil / deCompress

Method deCompress

src/main/java/com/opslab/util/ZIPUtil.java:20–30  ·  view source on GitHub ↗

文档压缩 @param file 需要压缩的文件或目录 @param dest 压缩后的文件名称 @throws IOException

(File file, String dest)

Source from the content-addressed store, hash-verified

18 * @throws IOException
19 */
20 public static void deCompress(File file, String dest) throws IOException {
21 try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(dest))) {
22 String dir = "";
23 if (file.isDirectory()) {
24 dir = file.getName();
25 }
26 zipFile(file, zos, dir);
27 } catch (IOException e) {
28 throw e;
29 }
30 }
31
32 public static void zipFile(File inFile, ZipOutputStream zos, String dir) throws IOException {
33 if (inFile.isDirectory()) {

Callers 2

testDeCompressMethod · 0.95
zipDeCompressMethod · 0.95

Calls 1

zipFileMethod · 0.95

Tested by 1

testDeCompressMethod · 0.76