Package org.springframework.aot.generate
Class FileSystemGeneratedFiles
java.lang.Object
org.springframework.aot.generate.FileSystemGeneratedFiles
- All Implemented Interfaces:
GeneratedFiles
GeneratedFiles implementation that stores generated files using a
FileSystem.- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.aot.generate.GeneratedFiles
GeneratedFiles.FileHandler, GeneratedFiles.Kind -
Constructor Summary
ConstructorsConstructorDescriptionFileSystemGeneratedFiles(Path root) Create a newFileSystemGeneratedFilesinstance with all files stored under the specificroot.Create a newFileSystemGeneratedFilesinstance with all files stored under the root provided by the givenFunction. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler) Handle a generated file of the specifiedGeneratedFiles.Kindwith the given handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.aot.generate.GeneratedFiles
addClassFile, addFile, addFile, addFile, addResourceFile, addResourceFile, addResourceFile, addSourceFile, addSourceFile, addSourceFile, addSourceFile
-
Constructor Details
-
FileSystemGeneratedFiles
Create a newFileSystemGeneratedFilesinstance with all files stored under the specificroot. The following subdirectories are created for the different filekinds:sourcesresourcesclasses
- Parameters:
root- the root path- See Also:
-
FileSystemGeneratedFiles
Create a newFileSystemGeneratedFilesinstance with all files stored under the root provided by the givenFunction.- Parameters:
roots- a function that returns the root to use for the givenGeneratedFiles.Kind
-
-
Method Details
-
handleFile
public void handleFile(GeneratedFiles.Kind kind, String path, ThrowingConsumer<GeneratedFiles.FileHandler> handler) Description copied from interface:GeneratedFilesHandle a generated file of the specifiedGeneratedFiles.Kindwith the given handler. The file handler lets you consume the content of the already generated file, if any and provide a way to override its content if necessary.- Specified by:
handleFilein interfaceGeneratedFiles- Parameters:
kind- the kind of filepath- the relative path of the filehandler- a consumer of aGeneratedFiles.FileHandlerfor the file
-