类 FileSystemUtils
java.lang.Object
com.walker.infrastructure.utils.FileSystemUtils
Utility methods for working with the file system.
- 从以下版本开始:
- 2.5.3
- 作者:
- Rob Harrop, Juergen Hoeller
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidcopyRecursively(File src, File dest) Recursively copy the contents of thesrcfile/directory to thedestfile/directory.static booleandeleteRecursively(File root) Delete the suppliedFile- for directories, recursively delete any nested directories or files as well.static voidstatic StringtrimFileSchema(String path) 去掉文件路径中的协议信息,如:
-
字段详细资料
-
构造器详细资料
-
FileSystemUtils
public FileSystemUtils()
-
-
方法详细资料
-
trimFileSchema
去掉文件路径中的协议信息,如:file:///d:/test/my.log 去掉file:/// 在windows系统中也可能是file:/
- 参数:
path- 给定文件全路径信息- 返回:
- 返回修剪后的路径
-
deleteRecursively
Delete the suppliedFile- for directories, recursively delete any nested directories or files as well.- 参数:
root- the rootFileto delete- 返回:
trueif theFilewas deleted, otherwisefalse
-
copyRecursively
Recursively copy the contents of thesrcfile/directory to thedestfile/directory.- 参数:
src- the source directorydest- the destination directory- 抛出:
IOException- in the case of I/O errors
-
main
- 抛出:
Exception
-