public class ArchiveUtil extends Object
| 构造器和说明 |
|---|
ArchiveUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
gz(byte[] src) |
static void |
gz(File src,
File target) |
static void |
gz(File src,
OutputStream ops) |
static void |
gz(InputStream src,
File target) |
static void |
gz(InputStream src,
OutputStream ops) |
static void |
tarGz(File src,
File target)
压缩文件
|
static void |
tarGz(List<File> files,
File target)
将所有文件压缩在同一级目录。
|
static void |
tarGz(String fileName,
InputStream ips,
String target)
将流压缩到文件
|
static void |
tarGz(String src,
String target)
压缩文件
|
static byte[] |
unGz(byte[] src) |
static void |
unGz(File src,
File target) |
static void |
unGz(InputStream src,
OutputStream ops) |
static void |
unTarGz(File src,
File target) |
static void |
unzip(File src,
File target) |
static void |
zip(File src,
File target)
压缩文件
|
static void |
zip(List<File> files,
File target)
将所有文件压缩在同一级目录。
|
static void |
zip(String fileName,
InputStream ips,
File target)
将流压缩到文件
|
static void |
zip(String fileName,
InputStream ips,
String target)
将流压缩到文件
|
static void |
zip(String src,
String target)
压缩文件
|
public static final int ZIP
public static final int GZ
public static final int TAR
public static final int RAR
public static void zip(File src, File target) throws IOException
src - 源文件target - 目标zip文件IOExceptionpublic static void zip(String src, String target) throws IOException
src - 源文件target - 目标zip文件IOExceptionpublic static void zip(List<File> files, File target) throws IOException
files - 文件列表target - 目标zip文件IOExceptionpublic static void zip(String fileName, InputStream ips, String target) throws IOException
fileName - 流的文件名ips - 流target - 目标zip文件IOExceptionpublic static void zip(String fileName, InputStream ips, File target) throws IOException
fileName - 流的文件名ips - 流target - 目标zip文件IOExceptionpublic static void unzip(File src, File target) throws IOException
IOExceptionpublic static void tarGz(File src, File target) throws IOException
src - 源文件target - 目标tar.gz文件IOExceptionpublic static void tarGz(String src, String target) throws IOException
src - 源文件target - 目标tar.gz文件IOExceptionpublic static void tarGz(List<File> files, File target) throws IOException
files - 文件列表target - 目标tar.gz文件IOExceptionpublic static void tarGz(String fileName, InputStream ips, String target) throws IOException
fileName - 流的文件名ips - 流target - 目标tar.gz文件IOExceptionpublic static void unTarGz(File src, File target) throws IOException
IOExceptionpublic static void gz(File src, File target) throws IOException
IOExceptionpublic static void gz(File src, OutputStream ops) throws IOException
IOExceptionpublic static void gz(InputStream src, File target) throws IOException
IOExceptionpublic static byte[] gz(byte[] src)
throws IOException
IOExceptionpublic static void gz(InputStream src, OutputStream ops) throws IOException
IOExceptionpublic static void unGz(File src, File target) throws IOException
IOExceptionpublic static byte[] unGz(byte[] src)
throws IOException
IOExceptionpublic static void unGz(InputStream src, OutputStream ops) throws IOException
IOExceptionCopyright © 2022. All rights reserved.