com.vaadin.flow.server.frontend.
Class GeneratedFilesSupport
A helper for tasks to handle generated files.
Allow to write file on disk only if the content has not changed. Generated files are tracked and can be fetched by post-processing tasks.
For internal use only. May be renamed or removed in a future release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFiles()
Gets paths of all generated files, whether they have been written to disk or not.
Gets paths of files generated under the given
root
folder.void
Marks the give file as generated by the task.
void
Marks the give file as generated by the task.
boolean
writeIfChanged
(File file, String content) Writes the given content into the given file unless the file already contains that content.
boolean
writeIfChanged
(File file, List<String> content) Writes the given content into the given file unless the file already contains that content.
boolean
writeIfChanged
(Path file, String content) Writes the given content into the given file unless the file already contains that content.
boolean
writeIfChanged
(Path file, List<String> content) Writes the given content into the given file unless the file already contains that content.
-
Constructor Details
-
GeneratedFilesSupport
public GeneratedFilesSupport()
-
-
Method Details
-
writeIfChanged
Writes the given content into the given file unless the file already contains that content.
Parameters:
file
- the file to write tocontent
- the lines to writeReturns:
true if the content was written to the file, false otherwise
Throws:
IOException
- if something went wrong -
writeIfChanged
Writes the given content into the given file unless the file already contains that content.
Parameters:
file
- the file to write tocontent
- the lines to writeReturns:
true if the content was written to the file, false otherwise
Throws:
IOException
- if something went wrong -
writeIfChanged
Writes the given content into the given file unless the file already contains that content.
Parameters:
file
- the file to write tocontent
- the content to writeReturns:
true if the content was written to the file, false otherwise
Throws:
IOException
- if something went wrong -
writeIfChanged
Writes the given content into the given file unless the file already contains that content.
Parameters:
file
- the file to write tocontent
- the content to writeReturns:
true if the content was written to the file, false otherwise
Throws:
IOException
- if something went wrong -
track
Marks the give file as generated by the task.
Parameters:
file
- the file to be marked as generated. -
track
Marks the give file as generated by the task.
Parameters:
file
- the file to be marked as generated. -
getFiles
Gets paths of all generated files, whether they have been written to disk or not.
Returns:
paths of files generated under the given
root
folder, never null. -
getFiles
Gets paths of files generated under the given
root
folder.Parameters:
root
- root folder to get generated files.Returns:
paths of files generated under the given
root
folder, never null.
-