Package com.luna.common.file.visitor
Class MoveVisitor
- All Implemented Interfaces:
FileVisitor<Path>
文件移动操作的FileVisitor实现,用于递归遍历移动目录和文件,此类非线程安全
此类在遍历源目录并移动过程中会自动创建目标目录中不存在的上级目录。
此类在遍历源目录并移动过程中会自动创建目标目录中不存在的上级目录。
- Since:
- 5.7.7
- Author:
- looly
-
Constructor Summary
-
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
-
MoveVisitor
构造- Parameters:
source
- 源Pathtarget
- 目标PathcopyOptions
- 拷贝(移动)选项
-
-
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
-