Class GeneratedFiles.FileHandler

java.lang.Object
org.springframework.aot.generate.GeneratedFiles.FileHandler
Enclosing interface:
GeneratedFiles

public abstract static class GeneratedFiles.FileHandler extends Object
Provide access to a particular file and offer convenient methods to retrieve, save, or override its content.
Since:
6.2
  • Constructor Details

  • Method Details

    • exists

      public boolean exists()
      Specify whether the file already exists.
      Returns:
      true if the file already exists
    • getContent

      @Nullable public InputStreamSource getContent()
      Return an InputStreamSource for the content of the file or null if the file does not exist.
    • create

      public void create(InputStreamSource content)
      Create a file with the given content.
      Throws:
      IllegalStateException - if the file already exists
    • override

      public void override(InputStreamSource content)
      Override the content of the file handled by this instance using the given content. If the file does not exist, it is created.
    • copy

      protected abstract void copy(InputStreamSource content, boolean override)