Class OutputFolder

java.lang.Object
com.vaadin.hilla.generator.typescript.OutputFolder

public final class OutputFolder extends Object
The folder the generated TypeScript is written to.

The files of a run replace the ones of the run before it: what was generated last time and is no longer is removed, along with the folders left empty by it, while anything the folder holds which the generator did not write is left alone. That is what the list of generated files is for, which is written beside them.

A file whose content has not changed is left untouched rather than written again, so that watching the folder, as the development server does, only sees what actually differs.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The file listing what the last run generated, which is how a later run tells its own files from the ones of the application.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Writes the files of one generation, and removes what the run before it left behind.

    Methods inherited from class java.lang.Object

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

    • FILE_LIST

      public static final String FILE_LIST
      The file listing what the last run generated, which is how a later run tells its own files from the ones of the application.
      See Also:
  • Constructor Details

    • OutputFolder

      public OutputFolder(Path folder)
  • Method Details

    • write

      public void write(List<GeneratedFile> files) throws IOException
      Writes the files of one generation, and removes what the run before it left behind.

      A generation of nothing leaves no list behind either: with nothing generated, nothing in the folder is the generator's any more.

      Parameters:
      files - the files of the generation, by their path relative to this folder
      Throws:
      IOException