public class ZipCopyVisitor extends SimpleFileVisitor<Path>
Constructor and Description |
---|
ZipCopyVisitor(Path source,
FileSystem fileSystem,
CopyOption... copyOptions)
构造
|
Modifier and Type | Method and Description |
---|---|
FileVisitResult |
preVisitDirectory(Path dir,
BasicFileAttributes attrs) |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attrs) |
postVisitDirectory, visitFileFailed
public ZipCopyVisitor(Path source, FileSystem fileSystem, CopyOption... copyOptions)
source
- 源Path,或基准路径,用于计算被拷贝文件的相对路径fileSystem
- 目标Zip文件copyOptions
- 拷贝选项,如跳过已存在等public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException
preVisitDirectory
in interface FileVisitor<Path>
preVisitDirectory
in class SimpleFileVisitor<Path>
IOException
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
visitFile
in interface FileVisitor<Path>
visitFile
in class SimpleFileVisitor<Path>
IOException
Copyright © 2024. All rights reserved.