Package com.luna.common.file.compress
Class ZipCopyVisitor
- All Implemented Interfaces:
FileVisitor<Path>
Zip文件拷贝的FileVisitor实现,zip中追加文件,此类非线程安全
此类在遍历源目录并复制过程中会自动创建目标目录中不存在的上级目录。
此类在遍历源目录并复制过程中会自动创建目标目录中不存在的上级目录。
- Since:
- 5.7.15
- Author:
- looly
-
Constructor Summary
ConstructorDescriptionZipCopyVisitor
(Path source, FileSystem fileSystem, CopyOption... copyOptions) 构造 -
Method Summary
Modifier and TypeMethodDescriptionpreVisitDirectory
(Path dir, BasicFileAttributes attrs) visitFile
(Path file, BasicFileAttributes attrs) Methods inherited from class java.nio.file.SimpleFileVisitor
postVisitDirectory, visitFileFailed
-
Constructor Details
-
ZipCopyVisitor
构造- Parameters:
source
- 源Path,或基准路径,用于计算被拷贝文件的相对路径fileSystem
- 目标Zip文件copyOptions
- 拷贝选项,如跳过已存在等
-
-
Method Details
-
preVisitDirectory
- Specified by:
preVisitDirectory
in interfaceFileVisitor<Path>
- Overrides:
preVisitDirectory
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
visitFile
- Specified by:
visitFile
in interfaceFileVisitor<Path>
- Overrides:
visitFile
in classSimpleFileVisitor<Path>
- Throws:
IOException
-