java.lang.Object
io.github.monsieurdoceo.filizer.storage.infrastructure.FileFactory

public final class FileFactory extends Object
Factory responsible for creating managed files.

Handles file name validation, directory creation, and file initialization.

  • Constructor Details

    • FileFactory

      public FileFactory()
      Initializes the file factory.

      No custom initialization is required.

  • Method Details

    • createFile

      public static File createFile(Path path, String name, FilizerExceptions errors)
      Creates a file from a parent directory path and file name.

      If the parent directories do not exist, they are created automatically.

      Parameters:
      path - the parent directory path
      name - the file name
      errors - the exception factory
      Returns:
      the created file
      Throws:
      IllegalArgumentException - if the file name is invalid
      IllegalStateException - if an I/O error occurs while creating the file