Class PathDeleter

java.lang.Object
org.miaixz.bus.core.io.file.PathDeleter

public class PathDeleter extends Object
文件删除封装
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Summary

    Constructors
    Constructor
    Description
    构造
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    清空目录
    void
    del()
    删除文件或者文件夹,不追踪软链 注意:删除文件夹时不会判断文件夹是否为空,如果不空则递归删除子文件或文件夹 某个文件删除失败会终止删除操作
    of(Path src)
    创建文件或目录移动器

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PathDeleter

      public PathDeleter(Path path)
      构造
      Parameters:
      path - 文件或目录,不能为null且必须存在
  • Method Details

    • of

      public static PathDeleter of(Path src)
      创建文件或目录移动器
      Parameters:
      src - 源文件或目录
      Returns:
      PathMover
    • del

      public void del() throws InternalException
      删除文件或者文件夹,不追踪软链 注意:删除文件夹时不会判断文件夹是否为空,如果不空则递归删除子文件或文件夹 某个文件删除失败会终止删除操作
      Throws:
      InternalException - IO异常
    • clean

      public void clean()
      清空目录