模块 mxlib.api

接口 FileListener


  • public interface FileListener
    A File listener. call by provider.
    • 方法概要

      修饰符和类型 方法 说明
      default void onDelete​(@NotNull Path fileOrDir)
      Called when the listening file/dir deleted.
      default void onDirCreate​(@NotNull Path dir)
      Called when the listening dir created.
      default void onFileChange​(@NotNull Path file, long oldSize, long newSize)
      Called when the listening file modified.
      default void onFileCreate​(@NotNull Path file)
      Called when the listening file created.
      default void onSubDirCreate​(@NotNull Path parent, @NotNull Path dir)
      Call when the listening dir created a new sub dir.
      default void onSubFileCreate​(@NotNull Path parent, @NotNull Path file)
      Call when the listening dir created a new sub file.
      default void onSubFileDelete​(@NotNull Path parent, @NotNull Path fileOrDir)
      Call when the listening dir deleted a file or dir.
    • 方法详细资料

      • onFileCreate

        default void onFileCreate​(@NotNull
                                  @NotNull Path file)
                           throws IOException
        Called when the listening file created.
        参数:
        file - The created file.
        抛出:
        IOException - IO Exception
      • onDirCreate

        default void onDirCreate​(@NotNull
                                 @NotNull Path dir)
                          throws IOException
        Called when the listening dir created.
        参数:
        file - The created dir.
        抛出:
        IOException - IO Exception
      • onDelete

        default void onDelete​(@NotNull
                              @NotNull Path fileOrDir)
                       throws IOException
        Called when the listening file/dir deleted.
        参数:
        file - The deleted file/dir.
        抛出:
        IOException - IO Exception
      • onFileChange

        default void onFileChange​(@NotNull
                                  @NotNull Path file,
                                  long oldSize,
                                  long newSize)
                           throws IOException
        Called when the listening file modified.
        参数:
        file - The modified file.
        newSize - The current file size
        oldSize - before changed's size
        抛出:
        IOException - IO Exception
      • onSubFileCreate

        default void onSubFileCreate​(@NotNull
                                     @NotNull Path parent,
                                     @NotNull
                                     @NotNull Path file)
                              throws IOException
        Call when the listening dir created a new sub file.
        参数:
        parent - The listening dir
        file - The created sub file
        抛出:
        IOException - IO Exception
      • onSubDirCreate

        default void onSubDirCreate​(@NotNull
                                    @NotNull Path parent,
                                    @NotNull
                                    @NotNull Path dir)
                             throws IOException
        Call when the listening dir created a new sub dir.
        参数:
        parent - The listening dir
        file - The created sub dir
        抛出:
        IOException - IO Exception
      • onSubFileDelete

        default void onSubFileDelete​(@NotNull
                                     @NotNull Path parent,
                                     @NotNull
                                     @NotNull Path fileOrDir)
                              throws IOException
        Call when the listening dir deleted a file or dir.
        参数:
        parent - The listening dir
        file - The deleted sub file/dir.
        抛出:
        IOException - IO Exception