Class FileUtils

java.lang.Object
io.github.intisy.gradle.inno.utils.FileUtils

public class FileUtils extends Object
File utility helpers for copying, creating, and deleting files and directories.

Provides folder copy, recursive delete, and mkdirs helpers used by the Inno Setup build workflow.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    copyFolder(Path source, Path target)
    Recursively copies a folder tree from a source path to a target path.
    static void
    delete(File file)
    Deletes a file if it exists, throwing a runtime exception on failure.
    static void
    Recursively deletes a folder tree if it exists.
    static boolean
    mkdirs(File file)
    Ensures a directory exists for the provided file (as directory).
    static boolean
    mkdirs(Path path)
    Ensures a directory exists for the provided path.

    Methods inherited from class java.lang.Object

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

    • FileUtils

      public FileUtils()
  • Method Details

    • copyFolder

      public static void copyFolder(Path source, Path target) throws IOException
      Recursively copies a folder tree from a source path to a target path.
      Parameters:
      source - root folder to copy
      target - destination root
      Throws:
      IOException - if walking or copying fails
    • delete

      public static void delete(File file)
      Deletes a file if it exists, throwing a runtime exception on failure.
      Parameters:
      file - file to delete
    • mkdirs

      public static boolean mkdirs(Path path)
      Ensures a directory exists for the provided path.
      Parameters:
      path - directory path to create
      Returns:
      true if the directory was created, false if it already existed
    • mkdirs

      public static boolean mkdirs(File file)
      Ensures a directory exists for the provided file (as directory).
      Parameters:
      file - directory to create
      Returns:
      true if the directory was created, false if it already existed
    • deleteFolder

      public static void deleteFolder(Path path) throws IOException
      Recursively deletes a folder tree if it exists.
      Parameters:
      path - root directory to delete
      Throws:
      IOException - if deletion fails